Skip to main content Switch to mobile version docler 2.5.3 Unified async interface to OCR and document-AI services for converting documents to markdown
pip install docler==2.5.3 Copy PIP instructions
A unified, async Python library for document conversion and OCR. Docler wraps many OCR and document-AI services behind one interface and turns PDFs, images and office documents into markdown with extracted images and metadata.
Unified interface: one DocumentConverter API over 10 cloud and local backends
Standardized output: markdown with page-break markers, extracted images and metadata
Async first: convert single files, batches or whole directories (local or remote via fsspec)
Page ranges and encrypted PDFs: page_range="1-5,10", pdf_password=...
Chunking: markdown-, token-, LlamaIndex- and LLM-based chunkers
Serializable configs: every provider has a pydantic config model (docler_config)
Ready-made frontends: FastAPI server, MCP server, Streamlit UIs, docler CLI
pip install docler # core (no backend SDKs) pip install "docler[mistralai]" # Mistral OCR pip install "docler[light]" # cloud backends (Mistral, LlamaParse, Azure, ...) + LLM features pip install "docler[all]" # everything except Marker pip install "docler[marker]" # Marker, in a separate environment (see below) Further extras: azure, llama-parse, docling, markitdown, openai, diffs, server (FastAPI), mcp, streamlit, token-chunking, olmocr. Local backends such as Docling, Marker and MarkItDown run on Python 3.14 (not yet on 3.15, where some of their dependencies have no wheels).
Marker cannot be installed together with docler[all]/docler[light]: marker-pdf requires openai =3.31.
Azure Document Intelligence
from docler import AzureConverter converter = AzureConverter(endpoint="your-endpoint", api_key="your-key", model="prebuilt-layout") Mistral OCR
from docler import MistralConverter converter = MistralConverter(api_key="your-key", languages=["en", "fr", "de"]) LlamaParse
from docler import LlamaParseConverter converter = LlamaParseConverter(api_key="your-key", adaptive_long_table=True) Upstage Document AI
from docler import UpstageConverter converter = UpstageConverter(api_key="your-key", chart_recognition=True) DataLab
from docler import DataLabConverter converter = DataLabConverter( api_key="your-key", use_llm=False, # Enable for higher accuracy ) Local/Self-Hosted Providers
from docler import MarkerConverter converter = MarkerConverter( dpi=192, use_llm=True, # Requires local LLM setup llm_provider="ollama", ) Docling
from docler import DoclingConverter converter = DoclingConverter(ocr_engine="rapid_ocr", image_scale=2.0) Docling Remote
from docler.converters.docling_remote_provider import DoclingRemoteConverter # docling-serve >= 1.0 (its `/v1` API) converter = DoclingRemoteConverter(endpoint="http://localhost:5001", ocr_engine="rapid_ocr") MarkItDown (Microsoft)
from docler import MarkItDownConverter converter = MarkItDownConverter() LLM-Based Providers
from docler import LLMConverter converter = LLMConverter( model="openai:gpt-4o", # any pydantic-ai model identifier system_prompt="Extract text preserving formatting...", ) Provider Comparison
AggregatedConverter picks a suitable registered converter per MIME type:
Process entire directories with progress tracking:
from docler import DirectoryConverter, MarkerConverter base_converter = MarkerConverter() dir_converter = DirectoryConverter(base_converter, chunk_size=10) # Convert all supported files results = await dir_converter.convert("./documents/") # Or with progress tracking async for state in dir_converter.convert_with_progress("./documents/"): print(f"Progress: {state.processed_files}/{state.total_files}") print(f"Current: {state.current_file}") if state.errors: print(f"Errors: {len(state.errors)}") Page Range Processing
Extract specific pages from documents:
Process multiple files efficiently:
files = ["doc1.pdf", "doc2.png", "doc3.docx"] results = await converter.convert_files(files) for file, result in zip(files, results): print(f"{file}: {len(result.content)} characters extracted") Chunking
from docler.chunkers.markdown_chunker import MarkdownChunker chunker = MarkdownChunker(max_chunk_size=1500) chunked = await chunker.chunk(doc) # ChunkedDocument for chunk in chunked.chunks: print(chunk.chunk_index, chunk.page_number, len(chunk.content), len(chunk.images)) Other chunkers: TokenAwareChunker (docler.chunkers.token_chunker, extra token-chunking), LlamaIndexChunker (docler.chunkers.llamaindex_chunker) and AIChunker (docler.chunkers.ai_chunker, LLM-based).
Every provider has a serializable pydantic config, handy for config files and the HTTP API:
from docler_config.converter_configs import MistralConfig converter = MistralConfig(languages=["en"]).get_provider() Server, MCP and CLI
docler api --port 8000 # FastAPI server on 127.0.0.1 (extra: server) docler mcp --transport stdio # MCP server with a convert_to_markdown tool (extra: mcp) docler ocr_ui # Streamlit OCR UI (extra: streamlit) docler chunk_ui # Streamlit chunking UI See src/docler_api/README.md for the API endpoints (/v1/...), its bearer-token auth (DOCLER_API_TOKEN, required on any non-loopback host), CORS and the upload limit. A Dockerfile and compose.yml are included for running the API server (set DOCLER_API_TOKEN in .env).
All converters return a standardized Document object with:
class Document: # docler.markdown.Document content: str # Extracted text in markdown format images: list[Image] # Extracted images (id, content, mime_type, filename, ...) title: str | None # Document title author: str | None created: datetime | None modified: datetime | None source_path: str | None # Original file path mime_type: str | None # File MIME type metadata: dict[str, Any] # Provider-specific metadata The markdown content includes standardized metadata for page breaks and structure:
# Document Title Content from page 1... More content from page 2... Environment Variables
Configure API keys via environment variables:
export AZURE_DOC_INTELLIGENCE_ENDPOINT="your-endpoint" export AZURE_DOC_INTELLIGENCE_KEY="your-key" export MISTRAL_API_KEY="your-key" export LLAMAPARSE_API_KEY="your-key" export UPSTAGE_API_KEY="your-key" export DATALAB_API_KEY="your-key" LLM-based components (LLMConverter, AIChunker, annotators) use the usual provider variables of pydantic-ai, e.g. OPENAI_API_KEY or GEMINI_API_KEY.
Contributions are welcome. See AGENTS.md for the project layout and dev commands.
MIT License - see LICENSE for details.
Documentation: https://phil65.github.io/docler/
PyPI: https://pypi.org/project/docler/
GitHub: https://github.com/phil65/docler/
Issues: https://github.com/phil65/docler/issues
Discussions: https://github.com/phil65/docler/discussions
Coming Soon: FastAPI demo with bring-your-own-keys on https://contexter.net
Spec: Azure Document Intel
Spec: Upstage Document Parse
Author: Philipp Temminghoff
Both files in this release have provenance metadata.
MIT View SPDX License List
all azure diffs docling light llama-parse marker markitdown mcp mistralai olmocr openai server streamlit token-chunking
azure-document-intelligence chunking docling document-conversion document-processing llm markdown mistral ocr pdf
Development Status 4 - Beta
Intended Audience Developers
Operating System OS Independent
Programming Language Python :: 3
Topic Scientific/Engineering :: Image Recognition
Software Development :: Libraries :: Python Modules
Text Processing :: Markup :: Markdown
Release files for docler 2.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 2.9 MB
Release files / docler-2.5.3.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Release files / docler-2.5.3-py3-none-any.whl
Both files in this release have been uploaded with provenance metadata.
With provenance docler-2.5.3.tar.gz Dec 1, 2026
With provenance docler-2.5.3-py3-none-any.whl Dec 1, 2026
Attestation for docler-2.5.3.tar.gz
Attestation for docler-2.5.3-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Dec 1, 2026 2 release files Full provenance
Nov 26, 2026 2 release files Full provenance
Nov 23, 2026 2 release files Full provenance
Nov 22, 2026 2 release files Full provenance
Nov 19, 2026 2 release files Full provenance
Jan 4, 2026 2 release files No provenance
Dec 7, 2025 2 release files Full provenance
Dec 6, 2025 2 release files Full provenance
Dec 4, 2025 2 release files Full provenance
Dec 3, 2025 2 release files Full provenance
Oct 7, 2025 2 release files Full provenance
Oct 6, 2025 2 release files Full provenance
Oct 3, 2025 2 release files Full provenance
Sep 22, 2025 2 release files Full provenance
Aug 5, 2025 2 release files Full provenance
Jun 5, 2025 2 release files Full provenance
May 22, 2025 2 release files Full provenance
May 19, 2025 2 release files Full provenance
May 13, 2025 2 release files Full provenance
May 8, 2025 2 release files Full provenance
May 5, 2025 2 release files Full provenance
Apr 30, 2025 2 release files Full provenance
Apr 23, 2025 2 release files Full provenance
Apr 10, 2025 2 release files Full provenance
Apr 3, 2025 2 release files Full provenance
Mar 26, 2025 2 release files Full provenance
Mar 19, 2025 2 release files Full provenance
Mar 9, 2025 2 release files Full provenance
Mar 8, 2025 2 release files No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation




