Files
Orchestrator/privat/NoteGraph/ingestion/extraction/base.py
T
ankn a5f8fb49ab Migrate all repos into monorepo context folders
Bahn: aisupport, Analyse-O2C-C2S, awesome-bahn-mcp-servers, beam-mcp,
      Confluence_Bot, db-planet-mcp-server, O2C-Harness, project-audit,
      Projekt-KIQ-HP, teamlandkarte-mcp
Dhive: Jury-Voting
Privat: CV, NoteGraph (NOTE: NoteGraph needs complete redo after consolidation)
Shared: AI-Orchestrator, OrgMyLife, power_skills_and_more
Shared/references: symphony (read-only)

Bahn repos remain available as independent remotes - this monorepo
pulls them in via subtree, the originals are untouched.
2026-06-30 20:39:52 +02:00

28 lines
754 B
Python

"""Base protocol and data structures for text extraction."""
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Protocol
@dataclass
class ExtractionResult:
"""Result of extracting text from a document."""
text: str
source_file: Path
extraction_method: str # "direct", "ocr", "mixed"
metadata: dict[str, Any] = field(default_factory=dict)
class TextExtractor(Protocol):
"""Protocol that all text extractors must implement."""
def can_handle(self, file_path: Path) -> bool:
"""Return True if this extractor can process the given file."""
...
def extract(self, file_path: Path) -> ExtractionResult:
"""Extract text content from the file."""
...