Kreuzberg is a versatile Python library designed for efficient text extraction from a variety of document formats, including PDFs, images, and Microsoft Office files. By providing a simple and clean API with no external dependencies, it ensures hassle-free local processing, making it an ideal choice for modern applications with minimal overhead.
Kreuzberg is an advanced Python library designed for seamless text extraction from a variety of documents including PDFs, images, office documents, and more. This library features a unified asynchronous interface, making it simple and efficient to retrieve text content.
Kreuzberg combines several powerful tools for its functionality:
pdfium2 for searchable content and Tesseract OCR for scanned PDFs.python-pptx), HTML, and Excel (calamine).Kreuzberg supports a multitude of formats, including:
.docx), PowerPoint (.pptx), OpenDocument Text (.odt), EPUB, LaTeX, and more.The library provides both asynchronous and synchronous APIs for text extraction. Essential functions include:
async def extract_document():
pdf_result = await extract_file("document.pdf")
img_result = await extract_file("scan.png", language="deu")
docx_result = await extract_file(Path("document.docx"))
Kreuzberg also supports batch processing for efficient handling of multiple files or contents, facilitating both async and sync operations:
async def process_documents(file_paths: list[Path]) -> None:
results = await batch_extract_file(file_paths)
Kreuzberg features comprehensive error handling to assist users with any potential issues that may arise during text extraction, including handling for validation errors, OCR inaccuracies, and dependency issues.
Kreuzberg welcomes contributions from the community. Interested developers can contribute by following the local development guidelines provided in the repository.
Explore Kreuzberg to enhance your text extraction tasks and streamline workflows with its powerful capabilities.
No comments yet.
Sign in to be the first to comment.