Skip to content

Releases

v0.3.0 — Opt-in OCR, rich PDF metadata, and TeX-free releases

Choose a tag to compare

@undacmic undacmic released this 26 Oct 19:48
26c4416

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 explicit offline=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, and diagnostics groups. 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.0

Requires 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 PATH reproduced 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

Choose a tag to compare

@undacmic undacmic released this 06 Aug 11:37

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) and PdfInspectorParser (BaseBlobParser), usable from the standalone langchain_pdf_inspector namespace.
  • 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" (one Document, default) or mode="page" (one Document per page, with layout flags like needs_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 — source and 1-indexed page on every doc, plus pdf_type/total_pages when 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).