Files
breakpilot-lehrer/klausur-service/backend/ocr_labeling_api.py
Benjamin Admin 34da9f4cda [split-required] Split 700-870 LOC files across all services
backend-lehrer (11 files):
- llm_gateway/routes/schools.py (867 → 5), recording_api.py (848 → 6)
- messenger_api.py (840 → 5), print_generator.py (824 → 5)
- unit_analytics_api.py (751 → 5), classroom/routes/context.py (726 → 4)
- llm_gateway/routes/edu_search_seeds.py (710 → 4)

klausur-service (12 files):
- ocr_labeling_api.py (845 → 4), metrics_db.py (833 → 4)
- legal_corpus_api.py (790 → 4), page_crop.py (758 → 3)
- mail/ai_service.py (747 → 4), github_crawler.py (767 → 3)
- trocr_service.py (730 → 4), full_compliance_pipeline.py (723 → 4)
- dsfa_rag_api.py (715 → 4), ocr_pipeline_auto.py (705 → 4)

website (6 pages):
- audit-checklist (867 → 8), content (806 → 6)
- screen-flow (790 → 4), scraper (789 → 5)
- zeugnisse (776 → 5), modules (745 → 4)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-25 08:01:18 +02:00

82 lines
2.0 KiB
Python

"""
OCR Labeling API — Barrel Re-export
Split into:
- ocr_labeling_models.py — Pydantic models and constants
- ocr_labeling_helpers.py — OCR wrappers, image storage, hashing
- ocr_labeling_routes.py — Session/queue/labeling route handlers
- ocr_labeling_upload_routes.py — Upload, run-OCR, export route handlers
All public names are re-exported here for backward compatibility.
"""
# Models
from ocr_labeling_models import ( # noqa: F401
LOCAL_STORAGE_PATH,
SessionCreate,
SessionResponse,
ItemResponse,
ConfirmRequest,
CorrectRequest,
SkipRequest,
ExportRequest,
StatsResponse,
)
# Helpers
from ocr_labeling_helpers import ( # noqa: F401
VISION_OCR_AVAILABLE,
PADDLEOCR_AVAILABLE,
TROCR_AVAILABLE,
DONUT_AVAILABLE,
MINIO_AVAILABLE,
TRAINING_EXPORT_AVAILABLE,
compute_image_hash,
run_ocr_on_image,
run_vision_ocr_wrapper,
run_paddleocr_wrapper,
run_trocr_wrapper,
run_donut_wrapper,
save_image_locally,
get_image_url,
)
# Conditional re-exports from helpers' optional imports
try:
from minio_storage import upload_ocr_image, get_ocr_image, MINIO_BUCKET # noqa: F401
except ImportError:
pass
try:
from training_export_service import ( # noqa: F401
TrainingExportService,
TrainingSample,
get_training_export_service,
)
except ImportError:
pass
try:
from hybrid_vocab_extractor import run_paddle_ocr # noqa: F401
except ImportError:
pass
try:
from services.trocr_service import run_trocr_ocr # noqa: F401
except ImportError:
pass
try:
from services.donut_ocr_service import run_donut_ocr # noqa: F401
except ImportError:
pass
try:
from vision_ocr_service import get_vision_ocr_service, VisionOCRService # noqa: F401
except ImportError:
pass
# Routes (router is the main export for app.include_router)
from ocr_labeling_routes import router # noqa: F401
from ocr_labeling_upload_routes import router as upload_router # noqa: F401