ocr-batch

Author
N. I.
Language
Python
Published
Published .
Links

ocr-batch processes a directory tree of PDFs through two complementary paths: local PyMuPDF extraction preserves the existing text layer of born-digital documents, while Mistral’s asynchronous batch API handles scans and handwriting. Both outputs use the same page separators, making the native text and OCR rendering easy to compare document by document.

The pipeline records uploads and batch jobs as they are created, so interrupted runs can resume without submitting completed work again. It writes text, Markdown, and raw JSON outputs for each PDF and cleans up the uploaded originals when remote processing finishes.