How silentprior/paperless-paddle-ocr works
paperless-paddle-ocr is a configurable sidecar that finds tagged paperless-ngx documents, claims and downloads them, extracts text with PaddleOCR, then updates content and workflow tags. Its main user-to-result path runs from document tagging through polling, OCR, and API update; daemon/one-shot and dry-run modes alter how that work runs. Runtime behavior is concentrated in the single sampled source file, so several nodes share its path. Unshown implementation details are omitted; documented capabilities are included where supported.
Main entry points: ocr_worker.py Environment config
Components 18
Worker runtime
- Environment config
ocr_worker.py - Worker entrypoint
ocr_worker.py - Run control
ocr_worker.py - API readiness
ocr_worker.py - Health endpoint
ocr_worker.py
Paperless workflow
- Document polling
ocr_worker.py - Tag filtering
ocr_worker.py - Processing claim
ocr_worker.py - Document download
ocr_worker.py - Tag lookup
ocr_worker.py - Content and tags
ocr_worker.py - Failure tagging
ocr_worker.py
Document OCR
- PDF rendering
ocr_worker.py - Text extraction
ocr_worker.py
Other components
- Document tagger
- Paperless API
- PaddleOCR
- PyMuPDF
Connections 26
- Document tagger → Paperless API: tags documents
- Worker entrypoint → Environment config: loads settings
- Worker entrypoint → API readiness: checks availability
- Worker entrypoint → Run control: starts mode
- Run control → Document polling: polls documents
- Document polling → Paperless API: lists documents
- Document polling → Tag filtering: filters results
- Tag filtering → Tag lookup: resolves tags
- Tag lookup → Paperless API: reads or creates tags
- Document polling → Processing claim: dispatches documents
- Processing claim → Paperless API: sets processing tag
- Processing claim → Document download: continues processing
- Document download → Paperless API: downloads document
- Document download → PDF rendering: provides file
- PDF rendering → PyMuPDF: renders PDF pages
- PDF rendering → Text extraction: provides images
- Text extraction → PaddleOCR: runs prediction
- Text extraction → Content and tags: returns text
- Content and tags → Paperless API: patches content and tags
- Content and tags → Failure tagging: handles update errors
- Failure tagging → Paperless API: clears claim or tags error
- Worker entrypoint → Health endpoint: serves health status
- Environment config → Run control: sets run and dry-run behavior
- Environment config → Text extraction: sets OCR options
- Environment config → Document polling: sets tag criteria
- Environment config → PaddleOCR: selects engine