Skip to main content

SDK for the Datalab document intelligence API

Project description

Datalab SDK

A Python SDK for the Datalab API - a document intelligence platform powered by marker and surya.

See the full documentation at https://documentation.datalab.to.

Installation

pip install datalab-python-sdk

Quick Start

Authentication

Get your API key from https://www.datalab.to/app/keys:

export DATALAB_API_KEY="your_api_key_here"

Basic Usage

from datalab_sdk import DatalabClient

client = DatalabClient() # use env var from above, or pass api_key="your_api_key_here"

# Convert PDF to markdown
result = client.convert("document.pdf")
print(result.markdown)

# OCR a document
ocr_result = client.ocr("document.pdf")
print(ocr_result.pages)  # Get all text as string

Workflows

Workflows allow you to chain multiple document processing steps together. Each workflow consists of one or more steps that can depend on previous steps.

Note: All workflow operations require authentication. Make sure you have set your DATALAB_API_KEY environment variable or pass api_key when creating the client (see Authentication section above).

For more Workflow tips, see our examples here and documentation.

CLI Usage

The SDK includes a command-line interface:

# Convert document to markdown
datalab convert document.pdf

# OCR with JSON output
datalab ocr document.pdf --output-format json

# Workflow commands
datalab create-workflow --help
datalab execute-workflow --help
datalab get-execution-status --help
datalab list-workflows --help
datalab get-workflow --help
datalab visualize-workflow --help

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datalab_python_sdk-0.1.10.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datalab_python_sdk-0.1.10-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file datalab_python_sdk-0.1.10.tar.gz.

File metadata

  • Download URL: datalab_python_sdk-0.1.10.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.6

File hashes

Hashes for datalab_python_sdk-0.1.10.tar.gz
Algorithm Hash digest
SHA256 05681c67b375220341add7bf499f41119d2f6f37e7564462726531ed1d9f31a6
MD5 b988e768818763ed455897617dbed270
BLAKE2b-256 2d63793a6a9aca26e9c5e93dd121de7ad4737c86903aefee4975d6238fae4206

See more details on using hashes here.

File details

Details for the file datalab_python_sdk-0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for datalab_python_sdk-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 7f1e2756ed0a6c11bba9c396089aeca361b05d7c95673e3545c4d303385a4559
MD5 e9cd1f07550c42691c8e4a815775285e
BLAKE2b-256 f64d7bd75117adb65741d637ccec63e2ee349c0b96ecd9c9ad34e4a4a92ea5eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page