Install & Compatibility
Where this runs
tested against v4.9.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.10
✕ build_error
✓ 2.45s
py 3.11
✕ build_error
✓ 2.55s
py 3.12
✕ build_error
✓ 2.45s
py 3.13
✕ build_error
✓ 2.35s
94MB installed
● package 94MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
extract
✓ from kreuzberg import extract
✗ from kreuzberg import extract
This quickstart demonstrates how to perform basic text and styled HTML extraction using Kreuzberg's `extract` function with `ExtractionConfig` and `OutputFormat`. It shows how to specify the output format and customize HTML output with `HtmlOutputConfig`.
import os
from kreuzberg import extract, ExtractionConfig, OutputFormat, HtmlOutputConfig
# Create a dummy file for demonstration
with open("example.txt", "w") as f:
f.write("This is a test document for Kreuzberg extraction.")
# Example 1: Basic text extraction
config_text = ExtractionConfig(
output_format=OutputFormat.TEXT
)
result_text = extract("example.txt", config=config_text)
print("--- Text Extraction ---")
print(result_text.text)
# Example 2: HTML extraction with a specific theme
config_html = ExtractionConfig(
output_format=OutputFormat.HTML,
html_output=HtmlOutputConfig(theme="github")
)
result_html = extract("example.txt", config=config_html)
print("\n--- HTML Extraction (GitHub theme) ---")
print(result_html.html)
os.remove("example.txt") # Clean up the dummy file
Debug
Known issues
breakingKreuzberg requires Python 3.10 or newer. Installing or running the library on older Python versions will result in errors.fixUpgrade your Python environment to 3.10 or a more recent version (e.g., 3.11, 3.12).
affects: <4.0.0 (previous major versions might have supported older Pythons) and all versions >=4.0.0
gotchaWhen extracting in HTML format, versions 4.8.1 and later introduced default styling. If you were expecting plain, unstyled HTML, your output will now include CSS and semantic classes.fixTo get unstyled HTML, explicitly set `html_output=HtmlOutputConfig(theme="unstyled")` in your `ExtractionConfig`.
affects: >=4.8.1
gotchaVersions prior to 4.8.2 had a bug where legitimate repeated content (e.g., brand names, headers) in PDFs could be stripped, even if `strip_repeating_text` was not enabled or intended.fixUpgrade to `kreuzberg v4.8.2` or newer to resolve the issue with overly aggressive content stripping.
affects: <4.8.2
gotchaUsers on macOS ARM64 systems (e.g., M1/M2/M3 Macs) using `kreuzberg` versions older than `v4.7.3` might experience a `SIGBUS` (Bus error: 10) crash when processing archive files (ZIP, 7Z, TAR, GZIP).fixUpgrade `kreuzberg` to `v4.7.3` or a newer version to fix the archive extraction crash.
affects: <4.7.3
Upgrade
Version history
4.9.9latest on PyPI · released Jun 5, 2026
Audit
Dependencies
No dependency data recorded yet.