🔍 Code Extractor

class SimpleDataTable

Maturity: 44

A class representing a data table structure that contains a collection of SimpleDataRow objects, used in SharePoint search operations.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/simple_data_table.py
Lines:
6 - 17
Complexity:
simple

Purpose

SimpleDataTable is a client-side value object that encapsulates tabular data for SharePoint operations. It inherits from ClientValue and provides a structured way to manage collections of SimpleDataRow objects. This class is primarily used in SharePoint search and data retrieval scenarios where results need to be organized in a table format. The entity_type_name property identifies this object as 'SP.SimpleDataTable' for SharePoint API interactions.

Source Code

class SimpleDataTable(ClientValue):
    """Represents a data table"""

    def __init__(self, rows=None):
        """
        :param list[SimpleDataRow] rows: The rows in the data table.
        """
        self.Rows = ClientValueCollection(SimpleDataRow, rows)

    @property
    def entity_type_name(self):
        return "SP.SimpleDataTable"

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

rows: Optional list of SimpleDataRow objects to initialize the data table. Can be None to create an empty table, or a list of SimpleDataRow instances to pre-populate the table. The rows are stored in a ClientValueCollection which provides collection management capabilities.

Return Value

Instantiation returns a SimpleDataTable object with a Rows attribute containing a ClientValueCollection of SimpleDataRow objects. The entity_type_name property returns the string 'SP.SimpleDataTable' identifying the SharePoint entity type.

Class Interface

Methods

__init__(self, rows=None)

Purpose: Initializes a new SimpleDataTable instance with an optional collection of rows

Parameters:

  • rows: Optional list of SimpleDataRow objects to populate the table. Defaults to None for an empty table.

Returns: None (constructor)

@property entity_type_name(self) -> str property

Purpose: Returns the SharePoint entity type identifier for this data table

Returns: String 'SP.SimpleDataTable' representing the SharePoint entity type name

Attributes

Name Type Description Scope
Rows ClientValueCollection[SimpleDataRow] A collection of SimpleDataRow objects representing the rows in the data table. Provides methods for adding, removing, and iterating over rows. instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
from office365.sharepoint.search.simple_data_row import SimpleDataRow

Usage Example

from office365.sharepoint.search.simple_data_table import SimpleDataTable
from office365.sharepoint.search.simple_data_row import SimpleDataRow

# Create an empty data table
table = SimpleDataTable()

# Create a data table with initial rows
row1 = SimpleDataRow()
row2 = SimpleDataRow()
table_with_rows = SimpleDataTable(rows=[row1, row2])

# Access the rows collection
rows_collection = table_with_rows.Rows

# Get the entity type name
entity_type = table.entity_type_name  # Returns 'SP.SimpleDataTable'

# Add rows to an existing table
table.Rows.add(SimpleDataRow())

Best Practices

  • Initialize with rows parameter if you have data available at construction time to avoid multiple collection operations
  • Use the Rows.add() method to add individual rows after instantiation rather than directly manipulating the collection
  • The entity_type_name property is read-only and should not be modified as it's used for SharePoint API serialization
  • This class is designed to work within the office365 library ecosystem and should be used in conjunction with SharePoint client context
  • The Rows attribute is a ClientValueCollection which provides type safety for SimpleDataRow objects
  • When passing to SharePoint APIs, the object will be automatically serialized using the entity_type_name identifier

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SimpleDataRow 71.9% similar

    A class representing a single row in a data table, inheriting from ClientValue. It stores cell data as a dictionary and provides methods for property management.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/simple_data_row.py
  • class SpecialTermResult 57.5% similar

    A class representing a single row in the Table property of a SpecialTermResults Table from Microsoft Office Server Search REST API.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/special_term_result.py
  • class TeamSiteData 54.6% similar

    TeamSiteData is a SharePoint entity class that represents data associated with a team site in Office 365/SharePoint Online.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sites/team_site_data.py
  • class AnalyticsAction 53.8% similar

    A class representing an action in a Microsoft SharePoint Client Search Analytics Signal Object, inheriting from ClientValue.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/analytics/action.py
  • class SPOTenantWebTemplate 53.6% similar

    A client value class representing a SharePoint Online tenant web template in the Microsoft Online SharePoint Tenant Administration API.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/webs/templates/template.py
← Back to Browse