Repository navigation
Releases
Releases · undacmic/langchain-pdf-inspector
v0.3.0 — Opt-in OCR, rich PDF metadata, and TeX-free releases
What's new
- Selective OCR — opt-in
ocr_mode="off" | "auto" | "force"through both the parser and loader. Defaults to"off"and runs offline-first; downloads require explicitoffline=False. Page selection/order, Markdown-only validation, tuning options, and opt-in OCR provenance/diagnostics are supported. - Rich positioned and tagged metadata — opt-in
positions,structure, anddiagnosticsgroups. Values are ordinary JSON-compatible objects, preserve upstream field names, and never rewrite Markdown or reading order. - TeX-free releases — routine CI and publishing use checked-in real PDF fixtures and never install TeX or compile fixtures. Missing required fixtures fail clearly.
- Compatibility fixes — empty-text non-text positioned records are retained in opt-in metadata while document content and empty-page omission remain unchanged.
Existing defaults, content, page numbering, delimiters, and caller metadata precedence remain unchanged.
Install
pip install --upgrade langchain-pdf-inspector==0.3.0Requires Python 3.12+, langchain-core>=1.5.3,<2, and pdf-inspector>=1.25.2,<2.
Verification
- 181 tests passed; 1 explicitly opt-in real-model OCR test skipped.
- Clean tracked-file snapshot with no TeX on
PATHreproduced the same suite. - Ruff, formatting, mypy, fixture preflight, build, and distribution-content checks passed.
- The tag-triggered publish workflow passed quality, tests, build, artifact checks, and PyPI upload.
Known limitations
Real-model OCR and encrypted-file extraction were not executed as part of release validation. OCR requires compatible PDFium/ONNX Runtime libraries and a provisioned model; see the README for setup.
This release supersedes the unpublished v0.2.0 tag.
v0.1.1 — Initial release: LangChain document loader & parser for pdf-inspector
What's new
langchain-pdf-inspector is a new LangChain document loader and blob parser that wraps the Rust-backed pdf-inspector library, returning standard langchain_core.documents.Document objects for use in chains, retrievers, and vector stores. This is the initial release.
- Two integration classes —
PdfInspectorLoader(BasePDFLoader) andPdfInspectorParser(BaseBlobParser), usable from the standalonelangchain_pdf_inspectornamespace. - Four extraction paths — plain text, markdown (headings, lists, tables preserved), positional text with bounding boxes, and region-cropped text (
[x0, y0, x1, y1]rectangles). - Two modes —
mode="single"(oneDocument, default) ormode="page"(oneDocumentper page, with layout flags likeneeds_ocr/has_tables). - Flexible sources — loads PDFs from local files, web (HTTP/HTTPS), and S3 paths; remote files are downloaded to a temporary file.
- Rich metadata —
sourceand 1-indexedpageon every doc, pluspdf_type/total_pageswhen detection succeeds; caller metadata merges on top and wins on conflicts. - Python 3.12+, deps pinned (
langchain-core==1.5.3,pdf-inspector==0.2.6).