feat: group private apps into andreknie-privat

This commit is contained in:
2026-07-25 15:47:01 +02:00
parent 4c7d48ae6d
commit 2e83750cb7
109 changed files with 0 additions and 0 deletions
@@ -0,0 +1,51 @@
"""Text extraction layer for various document formats."""
from pathlib import Path
from .base import ExtractionResult, TextExtractor
from .docx import DocxExtractor
from .ocr import OCRExtractor
from .pdf import PDFExtractor
from .text import PlainTextExtractor
def get_extractor(file_path: Path, config=None):
"""Get the appropriate extractor for a file.
Args:
file_path: Path to the file to extract.
config: Optional IngestionConfig for LLM-based extraction.
Returns:
An extractor instance that can handle the file, or None.
"""
suffix = file_path.suffix.lower()
if suffix in (".md", ".txt"):
return PlainTextExtractor()
elif suffix == ".pdf":
if config:
return PDFExtractor(
ocr_enabled=config.ocr_enabled,
ocr_language=config.ocr_language,
llm_provider=config.llm_provider,
llm_model=config.llm_model,
mistral_api_key=config.mistral_api_key,
)
return PDFExtractor()
elif suffix in (".jpg", ".jpeg", ".png"):
return OCRExtractor()
elif suffix == ".docx":
return DocxExtractor()
return None
__all__ = [
"ExtractionResult",
"TextExtractor",
"PlainTextExtractor",
"PDFExtractor",
"OCRExtractor",
"DocxExtractor",
"get_extractor",
]