langchain-superpdf
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"]). A folder:
from pathlib import Path
docs = SuperPDFLoader(sorted(Path("papers").glob("**/*.pdf"))).load()
PDFs that arrive as bytes, such as uploads, go through the parser:
from langchain_core.documents.base import Blob
from langchain_superpdf import SuperPDFParser
blob = Blob.from_data(pdf_bytes, path="upload.pdf")
docs = list(SuperPDFParser().lazy_parse(blob))
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_superpdf-0.1.1.tar.gz | 12.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_superpdf-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.2 kB
Release files / langchain_superpdf-0.1.1.tar.gz
| Download URL | langchain_superpdf-0.1.1.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
159155062b236510c8eb14dd0f67012eb28bbd2ca219c7c828942bd548348b45
|
|
BLAKE2b-256 checksum How to use checksums |
ba9abbc07985c0144cca64ee7829a725ab5e0f4c5c49b9e0188a3710cac6e5ef
|
| 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 logRelease files / langchain_superpdf-0.1.1-py3-none-any.whl
| Download URL | langchain_superpdf-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
efa8f2ea7ff30e9d815500d44e7aecd9f1960104737fe0a5fe67f7150738ba94
|
|
BLAKE2b-256 checksum How to use checksums |
a772e8b3feb23babbe3b734535b598e1e3e9085a94e7e87b1a88fbbed0aa2e90
|
| 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