# Tables ## List tables in structured sheet `structured_sheets.tables.list(strstructured_sheet_id, TableListParams**kwargs) -> SyncCursorIDPage[TableResponse]` **get** `/v1/structured-sheets/{structured_sheet_id}/tables` List all tables extracted from the structured sheet. Only available when conversion status is 'completed'. ### Parameters - `structured_sheet_id: str` The unique identifier of the structured sheet conversion. - `after: Optional[str]` A cursor for pagination. Use the `last_id` from a previous response to fetch the next page of results. - `limit: Optional[int]` Maximum number of tables to return per page. ### Returns - `class TableResponse: …` Response representing a table extracted from a structured sheet. This is returned from GET (retrieve) and list table endpoints. Table names use a composite format: {normalized_sheet_name}__{table_name}. - `id: str` The unique identifier for this table. - `created_at: datetime` The timestamp when this table was created. - `name: str` Composite table name: {normalized_sheet_name}__{table_name}. Uses lowercase snake_case. Aggregation tables end with '__aggregations'. Two special metadata tables exist per structured sheet: '__deeptable_workbook_metadata' (workbook provenance info) and '__deeptable_table_overview' (summary of all tables). Example: 'staffing__head_count' or 'staffing__head_count__aggregations'. - `object: Literal["table"]` The object type, which is always 'table'. - `"table"` - `sheet_name: str` The original Excel sheet name this table came from. - `structured_sheet_id: str` The ID of the structured sheet this table belongs to. - `type: Literal["relational", "aggregation", "tableless", "metadata"]` The type of table (relational, aggregation, tableless, or metadata). - `"relational"` - `"aggregation"` - `"tableless"` - `"metadata"` ### Example ```python import os from deeptable import DeepTable client = DeepTable( api_key=os.environ.get("DEEPTABLE_API_KEY"), # This is the default and can be omitted ) page = client.structured_sheets.tables.list( structured_sheet_id="ss_01kfxgjd94fn9stqm42nejb627", ) page = page.data[0] print(page.id) ``` #### Response ```json { "data": [ { "id": "tbl_01kfxgjd94fn9stqm45rqr2pnz", "created_at": "2026-01-15T10:35:00Z", "name": "staffing__head_count", "object": "table", "sheet_name": "Staffing", "structured_sheet_id": "ss_01kfxgjd94fn9stqm42nejb627", "type": "relational" }, { "id": "tbl_02abc2def3ghjkmnpqrs4uvwxz", "created_at": "2026-01-15T10:35:00Z", "name": "staffing__head_count__aggregations", "object": "table", "sheet_name": "Staffing", "structured_sheet_id": "ss_01kfxgjd94fn9stqm42nejb627", "type": "aggregation" } ], "has_more": false, "object": "list", "first_id": "tbl_01kfxgjd94fn9stqm45rqr2pnz", "last_id": "tbl_02abc2def3ghjkmnpqrs4uvwxz" } ``` ## Retrieve a table `structured_sheets.tables.retrieve(strtable_id, TableRetrieveParams**kwargs) -> TableResponse` **get** `/v1/structured-sheets/{structured_sheet_id}/tables/{table_id}` Get details of a specific table extracted from the structured sheet. Only available when conversion status is 'completed'. ### Parameters - `structured_sheet_id: str` The unique identifier of the structured sheet conversion. - `table_id: str` The unique identifier of the table. ### Returns - `class TableResponse: …` Response representing a table extracted from a structured sheet. This is returned from GET (retrieve) and list table endpoints. Table names use a composite format: {normalized_sheet_name}__{table_name}. - `id: str` The unique identifier for this table. - `created_at: datetime` The timestamp when this table was created. - `name: str` Composite table name: {normalized_sheet_name}__{table_name}. Uses lowercase snake_case. Aggregation tables end with '__aggregations'. Two special metadata tables exist per structured sheet: '__deeptable_workbook_metadata' (workbook provenance info) and '__deeptable_table_overview' (summary of all tables). Example: 'staffing__head_count' or 'staffing__head_count__aggregations'. - `object: Literal["table"]` The object type, which is always 'table'. - `"table"` - `sheet_name: str` The original Excel sheet name this table came from. - `structured_sheet_id: str` The ID of the structured sheet this table belongs to. - `type: Literal["relational", "aggregation", "tableless", "metadata"]` The type of table (relational, aggregation, tableless, or metadata). - `"relational"` - `"aggregation"` - `"tableless"` - `"metadata"` ### Example ```python import os from deeptable import DeepTable client = DeepTable( api_key=os.environ.get("DEEPTABLE_API_KEY"), # This is the default and can be omitted ) table_response = client.structured_sheets.tables.retrieve( table_id="tbl_01kfxgjd94fn9stqm45rqr2pnz", structured_sheet_id="ss_01kfxgjd94fn9stqm42nejb627", ) print(table_response.id) ``` #### Response ```json { "id": "tbl_01kfxgjd94fn9stqm45rqr2pnz", "created_at": "2026-01-15T10:35:00Z", "name": "staffing__head_count", "object": "table", "sheet_name": "Staffing", "structured_sheet_id": "ss_01kfxgjd94fn9stqm42nejb627", "type": "relational" } ``` ## Download table data `structured_sheets.tables.download(strtable_id, TableDownloadParams**kwargs) -> BinaryResponseContent` **get** `/v1/structured-sheets/{structured_sheet_id}/tables/{table_id}/download` Download the table data in the specified format. Available formats: - `parquet`: Apache Parquet columnar format (recommended for data analysis) - `csv`: Comma-separated values (compatible with any spreadsheet application) ### Parameters - `structured_sheet_id: str` The unique identifier of the structured sheet conversion. - `table_id: str` The unique identifier of the table. - `format: Literal["parquet", "csv"]` The format to download the table data in. - `"parquet"` - `"csv"` ### Returns - `BinaryResponseContent` ### Example ```python import os from deeptable import DeepTable client = DeepTable( api_key=os.environ.get("DEEPTABLE_API_KEY"), # This is the default and can be omitted ) response = client.structured_sheets.tables.download( table_id="tbl_01kfxgjd94fn9stqm45rqr2pnz", structured_sheet_id="ss_01kfxgjd94fn9stqm42nejb627", format="parquet", ) print(response) content = response.read() print(content) ``` ## Domain Types ### Table Response - `class TableResponse: …` Response representing a table extracted from a structured sheet. This is returned from GET (retrieve) and list table endpoints. Table names use a composite format: {normalized_sheet_name}__{table_name}. - `id: str` The unique identifier for this table. - `created_at: datetime` The timestamp when this table was created. - `name: str` Composite table name: {normalized_sheet_name}__{table_name}. Uses lowercase snake_case. Aggregation tables end with '__aggregations'. Two special metadata tables exist per structured sheet: '__deeptable_workbook_metadata' (workbook provenance info) and '__deeptable_table_overview' (summary of all tables). Example: 'staffing__head_count' or 'staffing__head_count__aggregations'. - `object: Literal["table"]` The object type, which is always 'table'. - `"table"` - `sheet_name: str` The original Excel sheet name this table came from. - `structured_sheet_id: str` The ID of the structured sheet this table belongs to. - `type: Literal["relational", "aggregation", "tableless", "metadata"]` The type of table (relational, aggregation, tableless, or metadata). - `"relational"` - `"aggregation"` - `"tableless"` - `"metadata"`