Skip to main content

langchain-superpdf

PyPI License: Apache-2.0

superpdf.ai · Docs · GitHub

The LangChain document loader for superPDF AI: local PDFs as Markdown, page by page, ready for RAG. Headings stay Markdown headings, tables stay tables, charts drawn in the PDF come out as tables of their values, and scanned pages are read with OCR in 15 languages. Everything runs on your computer; nothing is uploaded.

Install

pip install -U langchain-superpdf

Python 3.10 or later on macOS, Linux or Windows. Node.js comes with the package; the first load installs the superPDF reader (about 220 MB) into your cache folder, once.

Use

from langchain_superpdf import SuperPDFLoader

docs = SuperPDFLoader("report.pdf").load()  # one Document per page
docs[0].page_content  # "# Quarterly report\n\nRevenue grew in every region…"
docs[0].metadata
# {"source": "report.pdf", "total_pages": 4, "creationdate": "", "creator": "…",
#  "producer": "…", "page": 0, "page_label": "1"}

page counts from 0 and page_label from 1, like LangChain's other PDF loaders.

Option Effect
mode="single" One Document for the whole PDF, pages joined with pages_delimiter
pages="1-3" Only these pages
tables="html" Tables as HTML, keeping merged header cells
ocr=False Skip OCR on scanned pages
timeout=1200 Seconds before giving up on one PDF (default 600)

Several files at once: SuperPDFLoader(["a.pdf", "b.pdf"]). For a folder, or PDFs that arrive as bytes, use the parser with any blob loader:

from langchain_community.document_loaders.generic import GenericLoader
from langchain_superpdf import SuperPDFParser

docs = GenericLoader.from_filesystem(
    "papers", glob="**/*.pdf", parser=SuperPDFParser()
).load()

Split by section

from langchain_text_splitters import MarkdownHeaderTextSplitter

splitter = MarkdownHeaderTextSplitter([("#", "title"), ("##", "section")])
chunks = []
for doc in docs:
    for chunk in splitter.split_text(doc.page_content):
        chunk.metadata.update(doc.metadata)  # keep source and page for citations
        chunks.append(chunk)

Agents (LangGraph)

For agents, use superPDF AI's MCP server: its 30 PDF tools (read, tables to Excel, Word export, merge, fill forms, compare and more) load as LangChain tools through langchain-mcp-adapters and run in any LangGraph agent. The tools can only use the folders you pass with --allow-dir.

from langchain.agents import create_agent
from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient(
    {
        "superpdf": {
            "command": "npx",
            "args": [
                "-y",
                "@superpdf/cli",
                "mcp",
                "--allow-dir",
                "/Users/you/Documents/superPDF",
            ],
            "transport": "stdio",
        }
    }
)
tools = await client.get_tools()
agent = create_agent("anthropic:claude-sonnet-5-5", tools)

More, including search with page citations: superpdf.ai/docs/python/langchain-llamaindex.

License

Apache-2.0. Part of superPDF AI.

Metadata

Release files for langchain-superpdf 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-superpdf 0.1.0
File Size Uploaded
langchain_superpdf-0.1.0.tar.gz 11.9 kB Details

Built distribution (wheel)

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

Total release size: 23.1 kB

Release files / langchain_superpdf-0.1.0.tar.gz

Download URL langchain_superpdf-0.1.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b639c6109e298e722f43adae68cc8d657a8ac11fcdbc481eef52ec37da3c6aae
BLAKE2b-256 checksum
How to use checksums
d46a1d0434c847f9b3a40dcec0c48fb49b1e4fd55a060effd6c81990744f6abb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

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

Download URL langchain_superpdf-0.1.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22cfea6275c304b62abf474bb961f9a837432b979ba5a50927d2324c00c85cd5
BLAKE2b-256 checksum
How to use checksums
717d739b38784e7509bff18bd54f4543e51c7c554944777eee22111718e570e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.1

2 release files

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