Skip to content
Get started

Create structured sheets

structured_sheets.create(StructuredSheetCreateParams**kwargs) -> StructuredSheetResponse
POST/v1/structured-sheets

Start converting a spreadsheet workbook into structured data. This initiates an asynchronous conversion process. Poll the returned resource using the id to check completion status.

ParametersExpand Collapse
file_id: str

The unique identifier of the file to convert.

sheet_names: Optional[SequenceNotStr[str]]

List of sheet names to convert. If None, all sheets will be converted.

ReturnsExpand Collapse
class StructuredSheetResponse:

Response representing a structured sheets conversion job.

This is returned from POST (create), GET (retrieve), and list endpoints.

id: str

The unique identifier for this structured sheets conversion.

created_at: datetime

The timestamp when the conversion was started.

formatdate-time
file_id: str

The unique identifier for the source file.

status: Literal["pending", "queued", "in_progress", 3 more]

The current processing status.

Accepts one of the following:
"pending"
"queued"
"in_progress"
"completed"
"failed"
"cancelled"
updated_at: datetime

The timestamp when the conversion was last updated.

formatdate-time
exports_available: Optional[List[str]]

List of export formats available for download (e.g., ['sqlite']).

last_error: Optional[LastError]

Error information when processing fails.

code: str

A machine-readable error code.

maxLength64
message: str

A human-readable description of the error.

maxLength1024
object: Optional[Literal["structured_sheet"]]

The object type, which is always 'structured_sheet'.

sheet_names: Optional[List[str]]

List of sheet names included in this conversion.

Create structured sheets
import os
from deeptable import DeepTable

client = DeepTable(
    api_key=os.environ.get("DEEPTABLE_API_KEY"),  # This is the default and can be omitted
)
structured_sheet_response = client.structured_sheets.create(
    file_id="file_01h45ytscbebyvny4gc8cr8ma2",
)
print(structured_sheet_response.id)
{
  "id": "ss_01abc2def3ghjkmnpqrs4uvwxy",
  "created_at": "2024-01-15T10:30:00Z",
  "file_id": "file_01abc2def3ghjkmnpqrs4uvwxy",
  "status": "completed",
  "updated_at": "2024-01-15T10:35:00Z",
  "exports_available": [
    "sqlite"
  ],
  "last_error": {
    "code": "invalid_file_format",
    "message": "The uploaded file is not a valid Excel spreadsheet."
  },
  "object": "structured_sheet",
  "sheet_names": [
    "Sheet1",
    "Financials"
  ]
}
Returns Examples
{
  "id": "ss_01abc2def3ghjkmnpqrs4uvwxy",
  "created_at": "2024-01-15T10:30:00Z",
  "file_id": "file_01abc2def3ghjkmnpqrs4uvwxy",
  "status": "completed",
  "updated_at": "2024-01-15T10:35:00Z",
  "exports_available": [
    "sqlite"
  ],
  "last_error": {
    "code": "invalid_file_format",
    "message": "The uploaded file is not a valid Excel spreadsheet."
  },
  "object": "structured_sheet",
  "sheet_names": [
    "Sheet1",
    "Financials"
  ]
}