Skip to main content

Installation

Requires Python 3.10 or higher.

Authentication

Set your API key as an environment variable (recommended):
Or pass it directly to the client:
Get your API key from the API Keys dashboard.

Quick Example

Client Options

Both sync and async clients accept the same configuration options:

Async Support

For high-throughput applications, use AsyncDatalabClient:
The async client is recommended when processing multiple documents concurrently.

Error Handling

The SDK raises specific exceptions for different error types:

Automatic Retries

The SDK automatically retries requests for:
  • 408 Request Timeout
  • 429 Rate Limit Exceeded
  • 5xx Server Errors
Retries use exponential backoff. You can control polling behavior with max_polls and poll_interval parameters on individual methods.

SDK Features

Document Conversion

Convert PDFs, images, and documents to Markdown, HTML, JSON, or chunks.

Structured Extraction

Extract structured data from documents using JSON schemas.

Document Segmentation

Segment documents into logical sections.

Form Filling

Fill PDF and image forms with structured field data.

Pipelines

Chain processors into versioned, reusable pipelines.

File Management

Upload, list, and manage files in Datalab storage.

CLI

Command-line interface for document conversion.

Method Summary

Next Steps

Document Conversion

Convert PDFs, images, and documents to Markdown, HTML, JSON, or chunks.

Structured Extraction

Extract structured data from documents using JSON schemas.

Document Segmentation

Segment documents into logical sections.

Form Filling

Fill PDF and image forms with structured field data.

Pipelines

Chain processors into versioned, reusable pipelines.

File Management

Upload, list, and manage files in Datalab storage.