Skip to main content

langchain-oxidize-pdf

LangChain document loader backed by oxidize-pdf, a fast Rust-powered PDF engine with first-class RAG chunking.

0.1.0 (2026-04-24) — Requires oxidize-pdf>=0.4.3 (oxidize-pdf-core 2.5.5). First release. The sibling llama-index-readers-oxidize-pdf 0.1.0 shipped with shape-only tests that missed a quadratic accumulation bug in the underlying chunker; this loader ships from day one with the semantic regression suite (test_loader_disjoint.py) that guarantees the disjointness contract end-to-end.

Install

pip install langchain-oxidize-pdf

Usage

LangChain convention binds the file path to the loader instance and uses lazy_load() as the primary entry point; load() is inherited from BaseLoader as a convenience that materializes the iterator.

RAG chunks (default)

from langchain_oxidize_pdf import OxidizePdfLoader

loader = OxidizePdfLoader("paper.pdf")  # mode="rag" by default
documents = loader.load()

for doc in documents:
    print(doc.metadata["chunk_index"], doc.metadata["heading_context"])
    print(doc.page_content[:200])

Each Document carries:

Field Description
chunk_index 0-based index within the document
page_numbers list of 1-indexed pages covered by the chunk
element_types list of semantic types detected (e.g. title, paragraph)
heading_context nearest surrounding heading, or None
token_estimate rough token count for budget planning
file_path / file_name / total_pages / pdf_version source metadata

One document per page

loader = OxidizePdfLoader("paper.pdf", mode="pages")
for doc in loader.lazy_load():
    print(doc.metadata["page_number"], len(doc.page_content))

Whole PDF as markdown

loader = OxidizePdfLoader("paper.pdf", mode="markdown")
[doc] = loader.load()
print(doc.page_content)

Adding caller metadata

loader = OxidizePdfLoader(
    "paper.pdf",
    extra_info={"source": "arxiv:2501.12345", "collection": "benchmarks"},
)

Keys in extra_info override base metadata (file_path, file_name, total_pages, pdf_version) if they collide — explicit caller intent.

Why oxidize-pdf

  • Rust parser: fast on large PDFs, low memory footprint.
  • Native RAG primitives: element-disjoint semantic chunking, element partitioning, heading-aware context — no post-processing needed. The disjointness contract (no chunk's text is a substring of another's; each source element appears in exactly one chunk) is enforced by regression tests in both this loader and the underlying bridge.
  • CJK friendly: compact output for multibyte documents (see oxidize-pdf 2.5.4 subsetter fixes).
  • Pure Python install: ships as a wheel for Linux/macOS/Windows via the oxidize-pdf package; no system dependencies.
  • Real lazy loading: lazy_load() returns a generator, so large PDFs don't force every Document into memory upfront.

Source

Part of oxidize-pdf-integrations, the ecosystem of integrations around oxidize-pdf. The Rust core and Python bridge live in oxidize-python.

License

MIT

Metadata

Release files for langchain-oxidize-pdf 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-oxidize-pdf 0.1.0
File Size Uploaded
langchain_oxidize_pdf-0.1.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-oxidize-pdf 0.1.0
File Interpreter ABI Platform
langchain_oxidize_pdf-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / langchain_oxidize_pdf-0.1.0.tar.gz

Download URL langchain_oxidize_pdf-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
67c7e834e4b109714f5e3e807120733643532f75588b58f616d5ef431588b20b
BLAKE2b-256 checksum
How to use checksums
b154c1acd610b9b0e77d36dd61f58d15e32c6d558d2abdd90d9790e0f34ca531
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release files / langchain_oxidize_pdf-0.1.0-py3-none-any.whl

Download URL langchain_oxidize_pdf-0.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
520c8e7df95690acaa242433ed04e50c20873e221b1962d938a6c11603567125
BLAKE2b-256 checksum
How to use checksums
309e115cadf2ea9dd89268e7f54fc3b647b195ecec128c18385ef45820d61b9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page