Datalab SDK Documentation
Our SDK is designed to help you quickly get started converting your documents. It supports:- Marker (document conversion) and OCR endpoints
- Sync and async mode
- Usage from Python or the CLI
- Single file or directory conversion
- Automatic saving of output
Installation
Authentication
Set your API key as an environment variable:Python Usage
Convert
The convert functionality uses the marker endpoint to convert documents to markdown, HTML, or JSON format.Basic Usage
Async Usage
Convert Options
TheConvertOptions
class supports all marker endpoint parameters. See more information on the parameters here.
Conversion Result
TheConversionResult
object contains the converted content and metadata. See more information on the return fields here.
Output Saving
You can save conversion results:OCR
The OCR functionality extracts text with detailed positional information from documents.Basic Usage
Async Usage
OCR Options
TheOCROptions
class supports OCR-specific parameters. See more information on the parameters here.
OCR Result
TheOCRResult
object contains detailed text and positional information. See more information on the return fields here.
Output Saving
CLI Usage
Authentication
Pass the--api_key
option or set the DATALAB_API_KEY
environment variable.