Add docTR as primary OCR engine with 2-tier sequential processing, OCR metrics tracking, and simplified engine selection. Features: - docTR OCR engine with light+medium preprocessing tiers - doctr_plus mode with early exit optimization (~65% fast path) - OCR metrics dashboard with per-engine statistics - User OCR preference persistence - Parallel worker pool for OCR processing - Cross-validation for extraction quality Engine options: tesseract, doctr, doctr_plus (recommended), paddleocr 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
36 lines
1.3 KiB
Python
36 lines
1.3 KiB
Python
"""Data Entry module router factory."""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
|
|
def create_data_entry_router() -> APIRouter:
|
|
"""
|
|
Create and configure Data Entry module router.
|
|
|
|
Includes all data entry endpoints:
|
|
- /receipts - Receipt CRUD and workflow
|
|
- /ocr - OCR processing for receipts
|
|
- /nomenclature - Nomenclature syncing from Oracle
|
|
- /settings - User settings (OCR preferences)
|
|
- /metrics - OCR analytics and metrics
|
|
|
|
Returns:
|
|
APIRouter: Configured router for data entry module
|
|
"""
|
|
router = APIRouter()
|
|
|
|
# Import routers here to avoid circular imports
|
|
from .receipts import router as receipts_router
|
|
from .ocr import router as ocr_router
|
|
from .nomenclature import router as nomenclature_router
|
|
from .ocr_settings import router as ocr_settings_router
|
|
|
|
# Include all sub-routers (no prefix - already prefixed in main.py with /api/data-entry)
|
|
router.include_router(receipts_router, prefix="/receipts", tags=["data-entry-receipts"])
|
|
router.include_router(ocr_router, prefix="/ocr", tags=["data-entry-ocr"])
|
|
router.include_router(nomenclature_router, prefix="/nomenclature", tags=["data-entry-nomenclature"])
|
|
# OCR settings and metrics (endpoints at /settings/* and /metrics/*)
|
|
router.include_router(ocr_settings_router, tags=["data-entry-settings"])
|
|
|
|
return router
|