Skip to content

feat(pdf): text extraction, OCR, and analyze endpoints - #29

Merged
simonhagger merged 4 commits into
mainfrom
feat/pdf-ocr-text-tools
Aug 24, 2026
Merged

feat(pdf): text extraction, OCR, and analyze endpoints#29
simonhagger merged 4 commits into
mainfrom
feat/pdf-ocr-text-tools

Conversation

@simonhagger

@simonhagger simonhagger commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Summary

Adds three new Python sidecar endpoints for document/text processing:

  • /extract-text: PDF text extraction via PyMuPDF fitz (per-page)
  • /ocr: OCR pipeline via pytesseract + tesseract binary
  • /analyze-text: text utility analysis (word count, paragraph count, normalization, language detection)

Adds TypeScript text processing utilities: \wordCount, \paragraphCount, \ runcate,
ormalizeWhitespace, \detectLanguage\ in \libs/util/common.

Changes

  • \service.py: /extract-text, /ocr, /analyze-text handlers; proper cv2 import guard
  • \python.contract.ts: request/response schemas for all three endpoints
  • \channels.ts: channel keys for all three endpoints
  • \python-handlers.ts: validated IPC handlers for all three endpoints
  • \python-sidecar.ts: sidecar methods for all three endpoints
  • \python-api.ts: preload bridge methods
  • \desktop-api.ts: DesktopPythonApi interface methods
  • \common.ts: wordCount, paragraphCount, truncate, normalizeWhitespace, detectLanguage
  • \ est_service.py: 29 Python tests at 93% coverage

Validation

  • \pnpm nx run-many -t build test lint\ — all 12 projects pass

  • Python sidecar tests — 29 passed, 93% coverage (threshold: 90%)

  • \pnpm typecheck\ — clean

  • Security review completed

  • Threat model updated or N/A explained

  • Confirmed no secrets/sensitive data present in committed files

@simonhagger
simonhagger force-pushed the feat/pdf-ocr-text-tools branch from 620f094 to c21674c Compare August 24, 2026 15:41
@simonhagger
simonhagger merged commit 1172200 into main Aug 24, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant