kreuzberg: High-performance document intelligence library for Python. Extract text, metadata, and structured data from PDFs, Office documents, images, and 88+ formats. Powered by Rust core for 10-50x speed improvements. · Pythie
High-performance document intelligence library for Python. Extract text, metadata, and structured data from PDFs, Office documents, images, and 88+ formats. Powered by Rust core for 10-50x speed improvements.
Actively maintained. Last release 2 months ago, commits in 15 of the last 26 weeks. A safe choice.
Python
[!NOTE]
Kreuzberg v4 LTS — the long-term-support line for Kreuzberg v4 . Active development has moved to
Xberg (v5+), which receives all new features. This line receives
critical bug and security fixes until the end of 2026, on a best-effort basis .
See the migration guide & LTS policy →
Extract text, tables, images, and metadata from 91+ file formats and 248 programming languages including PDF, Office documents, and images. Native Python bindings with async/await support, multiple OCR backends (Tesseract, EasyOCR, PaddleOCR), and extensible plugin system.
Installation
Package Installation For async support and additional features:
pip install kreuzberg[async]
System Requirements
Python 3.10+ required
Optional: ONNX Runtime version 1.22.x for embeddings support
Optional: Tesseract OCR for OCR functionality
Quick Start
Basic Extraction Extract text, metadata, and structure from any supported document format:
import asyncio
from kreuzberg import extract_file, ExtractionConfig
async def main() -> None:
config = ExtractionConfig(
use_cache=True,
enable_quality_processing=True
)
result = await extract_file("document.pdf", config=config)
print(result.content)
asyncio.run(main())
Common Use Cases
Extract with Custom Configuration Most use cases benefit from configuration to control extraction behavior:
With OCR (for scanned documents):
import asyncio
from kreuzberg import extract_file
async def main() -> None:
result = await extract_file("document.pdf")
print(result.content)
asyncio.run(main())
Table Extraction import asyncio
from kreuzberg import extract_file
async def main() -> None:
result = await extract_file("document.pdf")
content: str = result.content
tables: int = len(result.tables)
format_type: str | None = result.metadata.format_type
print(f"Content length: {len(content)} characters")
print(f"Tables found: {tables}")
print(f"Format: {format_type}")
asyncio.run(main())
Processing Multiple Files import asyncio
from kreuzberg import extract_file, ExtractionConfig, OcrConfig, TesseractConfig
async def main() -> None:
config = ExtractionConfig(
force_ocr=True,
ocr=OcrConfig(
backend="tesseract",
language="eng",
tesseract_config=TesseractConfig(psm=3)
)
)
result = await extract_file("scanned.pdf", config=config)
print(result.content)
print(f"Detected Languages: {result.detected_languages}")
asyncio.run(main())
Async Processing For non-blocking document processing:
import asyncio
from pathlib import Path
from kreuzberg import extract_file
async def main() -> None:
file_path: Path = Path("document.pdf")
result = await extract_file(file_path)
print(f"Content: {result.content}")
print(f"MIME Type: {result.metadata.format_type}")
print(f"Tables: {len(result.tables)}")
asyncio.run(main())
Next Steps
Features
Supported File Formats (91+) 91+ file formats across 8 major categories with intelligent format detection and comprehensive metadata extraction.
Office Documents Category Formats Capabilities Word Processing .docx, .docm, .dotx, .dotm, .dot, .odtFull text, tables, images, metadata, styles Spreadsheets .xlsx, .xlsm, .xlsb, .xls, .xla, .xlam, .xltm, .xltx, .xlt, .odsSheet data, formulas, cell metadata, charts Presentations .pptx, .pptm, .ppsx, .potx, .potm, .pot, .pptSlides, speaker notes, images, metadata PDF .pdfText, tables, images, metadata, OCR support eBooks .epub, .fb2Chapters, metadata, embedded resources Database .dbfTable data extraction, field type support Hangul .hwp, .hwpxKorean document format, text extraction
Images (OCR-Enabled) Category Formats Features Raster .png, .jpg, .jpeg, .gif, .webp, .bmp, .tiff, .tifOCR, table detection, EXIF metadata, dimensions, color space Advanced .jp2, .jpx, .jpm, .mj2, .jbig2, .jb2, .pnm, .pbm, .pgm, .ppmOCR via hayro-jpeg2000 (pure Rust decoder), JBIG2 support, table detection, format-specific metadata Vector .svgDOM parsing, embedded text, graphics metadata
Web & Data Category Formats Features Markup .html, .htm, .xhtml, .xml, .svgDOM parsing, metadata (Open Graph, Twitter Card), link extraction Structured Data .json, .yaml, .yml, .toml, .csv, .tsvSchema detection, nested structures, validation Text & Markdown .txt, .md, .markdown, .djot, .rst, .org, .rtfCommonMark, GFM, Djot, reStructuredText, Org Mode
Email & Archives Category Formats Features Email .eml, .msgHeaders, body (HTML/plain), attachments, threading Archives .zip, .tar, .tgz, .gz, .7zFile listing, nested archives, metadata
Academic & Scientific Category Formats Features Citations .bib, .biblatex, .ris, .nbib, .enw, .cslStructured parsing: RIS (structured), PubMed/MEDLINE, EndNote XML (structured), BibTeX, CSL JSON Scientific .tex, .latex, .typst, .jats, .ipynb, .docbookLaTeX, Jupyter notebooks, PubMed JATS Documentation .opml, .pod, .mdoc, .troffTechnical documentation formats
Code Intelligence (248 Languages) Feature Description Structure Extraction Functions, classes, methods, structs, interfaces, enums Import/Export Analysis Module dependencies, re-exports, wildcard imports Symbol Extraction Variables, constants, type aliases, properties Docstring Parsing Google, NumPy, Sphinx, JSDoc, RustDoc, and 10+ formats Diagnostics Parse errors with line/column positions Syntax-Aware Chunking Split code by semantic boundaries, not arbitrary byte offsets
Key Capabilities
Text Extraction - Extract all text content with position and formatting information
Metadata Extraction - Retrieve document properties, creation date, author, etc.
Table Extraction - Parse tables with structure and cell content preservation
Image Extraction - Extract embedded images and render page previews
OCR Support - Integrate multiple OCR backends for scanned documents
Async/Await - Non-blocking document processing with concurrent operations
Plugin System - Extensible post-processing for custom text transformation
Embeddings - Generate vector embeddings using ONNX Runtime models
Batch Processing - Efficiently process multiple documents in parallel
Memory Efficient - Stream large files without loading entirely into memory
Language Detection - Detect and support multiple languages in documents
Code Intelligence - Extract structure, imports, exports, symbols, and docstrings from 248 programming languages via tree-sitter
Configuration - Fine-grained control over extraction behavior
Performance Characteristics Format Speed Memory Notes PDF (text) 10-100 MB/s ~50MB per doc Fastest extraction Office docs 20-200 MB/s ~100MB per doc DOCX, XLSX, PPTX Images (OCR) 1-5 MB/s Variable Depends on OCR backend Archives 5-50 MB/s ~200MB per doc ZIP, TAR, etc. Web formats 50-200 MB/s Streaming HTML, XML, JSON
OCR Support Kreuzberg supports multiple OCR backends for extracting text from scanned documents and images:
Tesseract
Easyocr
Paddleocr
OCR Configuration Example import asyncio
from kreuzberg import extract_file
async def main() -> None:
result = await extract_file("document.pdf")
print(result.content)
asyncio.run(main())
Async Support This binding provides full async/await support for non-blocking document processing:
import asyncio
from pathlib import Path
from kreuzberg import extract_file
async def main() -> None:
file_path: Path = Path("document.pdf")
result = await extract_file(file_path)
print(f"Content: {result.content}")
print(f"MIME Type: {result.metadata.format_type}")
print(f"Tables: {len(result.tables)}")
asyncio.run(main())
Plugin System Kreuzberg supports extensible post-processing plugins for custom text transformation and filtering.
Embeddings Support Generate vector embeddings for extracted text using the built-in ONNX Runtime support. Requires ONNX Runtime installation.
Batch Processing Process multiple documents efficiently:
import asyncio
from kreuzberg import extract_file, ExtractionConfig, OcrConfig, TesseractConfig
async def main() -> None:
config = ExtractionConfig(
force_ocr=True,
ocr=OcrConfig(
backend="tesseract",
language="eng",
tesseract_config=TesseractConfig(psm=3)
)
)
result = await extract_file("scanned.pdf", config=config)
print(result.content)
print(f"Detected Languages: {result.detected_languages}")
asyncio.run(main())
Configuration For advanced configuration options including language detection, table extraction, OCR settings, and more:
Documentation
Contributing
License MIT License - see LICENSE file for details.
Support Popularity
Downloads, last 7 days 53.7K-17%
Stars, last 7 days –
Direct dependents 20
All dependents 20 80
Healthy
Maintenance, out of 100
Recent release
last release 68 days ago
Commit activity
15/26 weeks with commits
Release cadence
74 releases in 12 months
Issues & PRs handled
65% closed in the past year
Contributor spread
4 authors in last 100 commits
OpenSSF Scorecard
not evaluated
Commits, last 26 weeks 103
Releases
Latest 4.10.4
Released Sep 21, 2026
Releases, 12 months 74
First release Feb 1, 2025 Compatibility
Requires Python >=3.10
Tested on 3.10 · 3.11 · 3.12 · 3.13 · 3.14
License MIT (Permissive) AlternativesUse instead of kreuzberg: tools that do the same job, closest first.
Compare with pdf-inspector → Compare with docvortex → Compare with sharepoint-to-text → Compare all 4 →
Fast PDF inspection, classification, and text extraction with smart scanned vs text-based detection
File Formats & Parsing Text & NLP 20.1K 833.4K/moReleased Nov 24, 2026 A fast, multi-format document parsing and conversion engine
Text extraction library for typical file formats found in SharePoint repositories
A library that prepares raw documents for downstream ML tasks.
Text & NLP File Formats & Parsing 15.8K 2.6M/moReleased Nov 24, 2026 The fastest Python PDF library — 0.8ms mean, 5× faster than the industry leaders, 100% pass rate on 3,830 real-world PDFs. Text extraction, Markdown/HTML conversion, PDF creation and editing.
A Python wrapper for the opendataloader-pdf Java CLI.
Works well withUse together with kreuzberg: extensions, drivers, servers and companion tools.
pytesseract Pythie’s Index: 22Python-tesseract is a python wrapper for Google's Tesseract-OCR 26.6M downloads/mo