Docling

Parses PDF, DOCX, PPTX, HTML, images, audio, and more into a unified document representation built for generative AI pipelines.

Library
PyPI
v2.137.0
68,614 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
89 /100 Excellent
Development Activity 100
Maintenance 100
Community 68
Maturity 48
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 88
Code Quality 90
Innovation 85
Learning Curve 80

Docling is a document-processing library from IBM Research’s Deep Search team, now hosted under the LF AI & Data Foundation, that converts a wide range of file formats into a single unified representation called DoclingDocument. It handles PDF (with advanced layout analysis, reading-order detection, and table-structure recognition), Office formats (DOCX, PPTX, XLSX), web formats (HTML, Markdown), OpenDocument files, e-books, email, LaTeX, images, and even audio/video via ASR transcription.

Instead of returning raw text, Docling produces a structured, lossless representation that can be exported to Markdown, HTML, DocTags, or JSON, which makes it especially well suited as the ingestion layer for retrieval-augmented generation (RAG) and other LLM-powered applications. It ships plug-and-play integrations with LangChain, LlamaIndex, Crew AI, and Haystack, a built-in MCP server so agents can call it as a tool, and an optional API server (docling-serve) for running it as a standalone service.

What You Get

  • A DocumentConverter Python API and a docling CLI that convert dozens of input formats to a single DoclingDocument representation
  • Advanced PDF understanding: page layout, reading order, table structure, formula and code recognition, and image classification
  • Export to Markdown, HTML, WebVTT, DocTags, or lossless JSON, with schema support for USPTO patents, JATS articles, and XBRL financial reports
  • Local, fully offline execution suitable for sensitive data and air-gapped environments — no cloud dependency required
  • Ready-made integrations with LangChain, LlamaIndex, Crew AI, and Haystack, plus a built-in MCP server for agent tool-calling
  • Pluggable OCR, VLM (including GraniteDocling), and ASR backends selectable per pipeline for scanned documents, images, and audio/video

Common Use Cases

  • Building the ingestion layer of a RAG pipeline that needs clean Markdown or chunked JSON from heterogeneous source documents
  • Extracting structured tables and figures from scientific papers, financial reports, or technical PDFs for downstream analysis
  • Running fully local, offline document conversion in regulated or air-gapped environments where cloud OCR/parsing APIs are not an option
  • Wiring document parsing into an LLM agent via the built-in MCP server or the docling-serve API for on-demand conversion requests
  • Batch-converting large mixed-format document sets (PDF, DOCX, PPTX, HTML, email, ODF) into a single consistent schema for search indexing

Under The Hood

Architecture Docling is organized around a DocumentConverter that dispatches each input to a FormatOption pairing a document backend (in docling/backend/, one per format — PDF, DOCX, HTML, email, ODF, XML dialects like JATS/XBRL, etc.) with a pipeline class (in docling/pipeline/: SimplePipeline for straightforward formats, StandardPdfPipeline/ThreadedStandardPdfPipeline for layout-heavy PDF processing, plus dedicated AsrPipeline, VlmPipeline, and VideoPipeline). Backends parse a source into an intermediate representation; pipelines run a sequence of models (layout, OCR, table structure, picture description) over that representation and assemble the unified DoclingDocument. Model selection is not hardcoded — OCR engines, layout models, table models, and picture-description models are registered through a plugin/factory system (docling/models/factories/, docling/models/plugins/) using Python entry points, so third parties can register additional engines without modifying Docling’s core. If the core DoclingDocument schema changed, every backend and every export path (Markdown/HTML/JSON/DocTags) would need to change with it, since it’s the single representation all formats converge on.

Tech Stack Docling is a Python 3.10+ package built with hatchling, structured as a monorepo (packages/docling, packages/docling-slim, packages/docling-client) where the published docling package is a thin meta-package pinning docling-slim[standard], which contains the actual docling module. Core dependencies are Pydantic v2 (data models), docling-core (the DoclingDocument schema itself), and docling-parse plus pypdfium2 for PDF backends; format support is split into granular optional extras (format-pdf, format-docx, format-pptx, format-html, format-email, etc.) so consumers only install what they need. OCR/VLM/ASR are pluggable via extras for EasyOCR, Tesseract, RapidOCR, and Whisper-family models. Tooling includes uv for dependency management, ruff for linting/formatting, and ty for type checking, all wired through pre-commit hooks.

Code Quality The repository has over 140 test files under tests/, covering individual backends (test_backend_html.py, test_backend_docx.py, etc.), pipelines, ASR engines, and API scaffolding, run through GitHub Actions across multiple CI workflows (ci.yml, ci-main.yml, ci-heavy-examples.yml, pr-fast-checks.yml). Pre-commit enforces ruff linting and formatting, a license-header check on every Python file, and ty static type checking configured to warn on all rule categories. Pydantic models are used extensively for both public data structures and internal pipeline options, giving strong runtime validation and type safety throughout.

API Design The public surface centers on one entry point — DocumentConverter().convert(source) — that accepts a local path, URL, or in-memory stream and returns a ConversionResult wrapping the unified DoclingDocument, from which callers call .export_to_markdown() or similar. This single-converter, single-document-model design keeps the common case to two lines of code while pipeline options, format options, and backend options remain available for advanced configuration. The same conversion path is exposed identically through the docling CLI, the MCP server, and the optional docling-serve API, so users pick an interface without learning a different mental model for each.

Used by 5 apps in this directory

Python
100%
Apache 2.0

Agno

AI Development · Automation · Devops

42,644

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated today
Rust
53%
Apache 2.0

cocoindex

AI Development · Data Engineering

11,659

An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 53%
Python 47%
Updated today
Python
69%
MIT

Langflow

AI Agents · AI Development

155,451

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
65
Dependency
Built with
Python 69%
TypeScript 22%
Updated today
Python
65%
Other

Morphik

AI Development · Databases · Search

3,717

Morphik is an AI-native ingestion and retrieval engine that lets developers store, search, and reason over visually rich documents — scanned PDFs, manuals, slides, and video — without duct-taping together OCR, an embedding model, and a vector database.

View details
60
Repo Health
71
Technical
67
Dependency
Built with
Python 65%
TypeScript 23%
Updated 5 days ago
Python
68%
Apache 2.0

SurfSense

AI Assistants · Search

16,342

The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.

View details
88
Repo Health
71
Technical
66
Dependency
Built with
Python 68%
TypeScript 29%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers