Skip to main content

superpdf (Python)

PyPI Python License: Apache-2.0

Read PDFs into Markdown, HTML or JSON on your computer: headings, tables, charts as data and OCR for scanned pages. Nothing is uploaded.

This package is a thin Python wrapper around the superPDF command-line tool (npm package @superpdf/cli), so you get exactly what superpdf export produces. It includes a LangChain document loader and a LlamaIndex reader.

Requirements

Python 3.10 or later on macOS, Linux or Windows. Nothing else: Node.js comes with the package through nodejs-wheel-binaries.

The first call installs the superPDF reader (@superpdf/cli, about 185 MB with its PDF engine and OCR language data) from npm into your cache folder, once. To do that ahead of time, for example in a Docker image or before going offline:

python -c "import superpdf; superpdf.install_cli()"

Install

pip install superpdf
pip install "superpdf[langchain]"      # with the LangChain loader
pip install "superpdf[llama-index]"    # with the LlamaIndex reader
uv add superpdf                        # in a uv project

Or run the command without installing anything:

uvx superpdf export report.pdf --output report.md
pipx run superpdf export report.pdf --output report.md

Use

import superpdf

markdown = superpdf.export("report.pdf")  # the whole document as Markdown
html = superpdf.export("report.pdf", "html")
structure = superpdf.export_json("report.pdf")  # pages, blocks with type and position, sections

for page in superpdf.export_pages("report.pdf"):  # Markdown per page
    print(page["page"], page["markdown"][:80])

superpdf.export("report.pdf", pages="1,3-5", tables="html", ocr=False)
Option Meaning
format "markdown" (default), "html" or "json"
pages A selection such as "1,3-5"; all pages when omitted
tables "html" writes Markdown tables as HTML, keeping merged header cells (Markdown only)
ocr True (default) reads scanned pages with OCR in 15 languages; False skips it
timeout Seconds before giving up (default 600)

Errors raise superpdf.SuperPDFError with superPDF's own message, for example No file at report.pdf.

LangChain

from superpdf.langchain import SuperPDFLoader

docs = SuperPDFLoader("report.pdf").load()  # one Document per page
docs[0].metadata  # {"source": "report.pdf", "page": 1}

LlamaIndex

from superpdf.llama_index import SuperPDFReader

docs = SuperPDFReader(tables="html").load_data("report.pdf")  # one Document per page

Command line

The package installs a superpdf command that runs the full CLI (the same as python -m superpdf):

superpdf export report.pdf --output report.md
superpdf export report.pdf --tables html --output report.md
superpdf help

uvx superpdf … and pipx run superpdf … run it in a temporary environment, with nothing to install first.

How it works

Each call runs superpdf export in a subprocess (no shell) with the bundled Node.js and reads its output as UTF-8. The reader is @superpdf/cli at the version this package is tested with, installed once into your cache folder: ~/Library/Caches/superpdf on macOS, ~/.cache/superpdf on Linux and %LOCALAPPDATA%\superpdf\Cache on Windows (set SUPERPDF_CACHE_DIR to change it). To use your own build instead, set SUPERPDF_BIN to a superpdf command or superpdf.js. The reader, its tables, charts and OCR are described in the main README.

License

Apache-2.0.

Metadata

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

Built distribution (wheel)

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

Total release size: 27.5 kB

Release files / superpdf-0.1.0.tar.gz

Download URL superpdf-0.1.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2112498fb59898f9aaea64d10c33451b25710515e2c87afede170c0e1d3b2d5f
BLAKE2b-256 checksum
How to use checksums
896dcb493ca5498127251363e4e9b2eb80fffee9ccfd8429509a8b6b2de41221
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 / superpdf-0.1.0-py3-none-any.whl

Download URL superpdf-0.1.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11d472ce65d354c84f0b63d76469df9ec49ea5c85c4fede436418b425b61f14e
BLAKE2b-256 checksum
How to use checksums
3b29e4dcf8db175b1be3ce361423d34d00829d9341571911a72818837e9dae5a
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.4.0

2 release files

0.3.1

2 release files

0.2.0

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