Skip to main content

rustypaper

Turn research PDFs into readable text and structured data.

Rustypaper converts scientific papers to Markdown, plain text, JSON, or Typst. Use it to save a paper as an editable document, prepare text for search or an LLM, or extract sections for your own analysis tools. Run it from the terminal, Python, or Rust.

It runs locally on your CPU. No GPU, AI model, API key, or document upload is required. It is designed for PDFs with selectable text, including one-column and two-column papers. It does not perform OCR on scans or image-only PDFs.

Quick start · Downloads · Python API · Limitations

Quick start

With Python 3.9 or newer:

pip install rustypaper
rustypaper convert paper.pdf --out paper.md

Replace paper.pdf with your PDF's path. This saves the converted Markdown to paper.md. Omit --out to print it in the terminal instead.

You can also run the same command through Python:

python -m rustypaper convert paper.pdf --out paper.md

The PyPI package includes both the terminal command and the Python library. Precompiled packages are available for the platforms below, so supported installations do not need a Rust compiler.

What does the output look like?

Rustypaper recognizes headings, paragraphs, figures, tables, equations, and references, and reconstructs the reading order of the paper. For example, the start of the Markdown from the repository's synthetic sample PDF is:

# Reliable Widget Measurements

Example Author

## Abstract

We describe a simple study of colored widgets on a wooden bench.

This is a shortened excerpt. Conversion quality varies with the paper's layout, especially for equations and complex tables. See limitations.

Choose the output that suits your workflow:

Format Useful for CLI option
Markdown Reading, editing, and use in notes or LLM workflows --format md (default)
Plain text Search and text processing --format text
JSON Working with sections, content blocks, and their page locations --format json
Typst Further editing and typesetting in Typst --format typst

Common tasks

Save plain text, structured JSON, or a Typst document:

rustypaper convert paper.pdf --format text --out paper.txt
rustypaper convert paper.pdf --format json --out paper.json
rustypaper convert paper.pdf --format typst --out paper.typ

Save figures alongside the Markdown, with links to the image files:

rustypaper convert paper.pdf --out paper.md --assets figures

Convert several papers into an output folder:

rustypaper convert first.pdf second.pdf --out converted

Each PDF gets its own output file. For multiple inputs, --out must be a directory.

For all options, run rustypaper convert --help. An optional --caveman light or --caveman hard setting shortens prose by removing selected words and phrases. It is off by default and changes the wording, so use the default when you want the original prose.

Install without Python

Download an executable from the latest release. These downloads do not require Python or a Rust compiler.

Your computer Archive name contains
Linux on Intel or AMD, 64-bit x86_64-unknown-linux-gnu
Linux on ARM64 aarch64-unknown-linux-gnu
Mac with an Intel processor x86_64-apple-darwin
Mac with Apple Silicon aarch64-apple-darwin
Windows on Intel or AMD, 64-bit x86_64-pc-windows-msvc

Extract the archive, then run ./rustypaper --help on Linux or macOS, or .\rustypaper.exe --help in Windows PowerShell. Put the executable in a folder on your PATH to use rustypaper from any directory. The release includes SHA256SUMS for verifying downloads. Standalone Linux executables require glibc 2.35 or newer.

If you use cargo-binstall, it can download the executable for you:

cargo binstall rustypaper

With a Rust toolchain installed, you can also compile from source:

cargo install rustypaper --locked

Python API

After pip install rustypaper, convert a PDF directly in your Python code:

from pathlib import Path
import rustypaper

markdown = rustypaper.to_markdown("paper.pdf")
Path("paper.md").write_text(markdown, encoding="utf-8")

To get readable text and structured data from a single conversion:

import rustypaper

result = rustypaper.convert("paper.pdf")
print(result.markdown)

document = result.document
for section in document["sections"]:
    print(section["title"], section["first_page"], section["last_page"])

The document contains a title, typed content blocks, and a section outline. Blocks carry text and page positions. Sections include nested children and start / end indices, so document["blocks"][section["start"]:section["end"]] selects a section's contents. Page numbers are zero-based. Content before the first heading has a section title of None.

Other helpers include to_text(), to_typst(), and to_document(). Image-only documents raise rustypaper.ScannedDocument.

Conversion quality and limitations

Rustypaper uses the text and geometry already present in a PDF to recover its structure. It is designed for scientific papers. Page layout can change during conversion.

  • Scanned or image-only documents need a separate OCR tool.
  • Equations, complex tables, and unusual layouts can be missed or reconstructed incorrectly.
  • Titles split over several lines, subtle subsection headings, and long bibliographies remain challenging. Check the converted output when those details matter to your workflow.

We evaluate conversion on 16 papers across 10 template families. Fifteen have usable source text for comparison. This small corpus helps us detect regressions, and results on other papers will depend on their layout. See the evaluation results and methodology for measurements of text recovery, equations, tables, references, and sections.

If a conversion looks wrong, open an issue. Include the Rustypaper version, the command you ran, what you expected, and a public PDF link or a small sample you can share. rustypaper --version prints the installed version.

For developers

Rustypaper is also a Rust crate. Add it to Cargo.toml:

[dependencies]
rustypaper = "0.2"

The Rust API exposes convert(), convert_with(), and extract(). PDF reading is provided by rustium-pdf. See the architecture notes for how conversion works, the evaluation guide for quality checks, and the release guide for packaging and publishing.

For local development on Linux, with Rust 1.94 or newer, Python 3.9 or newer, and pytest installed, run these commands from a clone of this repository:

scripts/build.sh
cargo test --release
PYTHONPATH=python pytest python/tests -q
python3 -m unittest discover -s eval/tests

scripts/build.sh builds both the CLI and the Python extension used by the tests. The Python tests use committed synthetic PDFs. To run the optional real-paper corpus tests, fetch the papers with scripts/fetch-corpus.sh before running the tests. See the evaluation guide for downloading reference sources and comparing results with the quality baseline.

For conversion diagnostics, rustypaper probe paper.pdf --pages summarizes the PDF, and rustypaper dump paper.pdf --page 0 --pretty shows the extracted page data.

License

Licensed under MIT or Apache 2.0, at your option.

Metadata

Release files for rustypaper 0.2.4

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

Source distribution (sdist)

Source distribution for rustypaper 0.2.4
File Size Uploaded Provenance Actions
rustypaper-0.2.4.tar.gz 189.5 kB With provenance Details for rustypaper-0.2.4.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rustypaper 0.2.4
File Actions
rustypaper-0.2.4-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for rustypaper-0.2.4-cp39-abi3-win_amd64.whl
rustypaper-0.2.4-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for rustypaper-0.2.4-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
rustypaper-0.2.4-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for rustypaper-0.2.4-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
rustypaper-0.2.4-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for rustypaper-0.2.4-cp39-abi3-macosx_11_0_arm64.whl
rustypaper-0.2.4-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for rustypaper-0.2.4-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 7.5 MB

Release files / rustypaper-0.2.4.tar.gz

Download URL rustypaper-0.2.4.tar.gz
Size 189.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fdffffd59c6c3eab688508f55086338fdace464409212e5dfc60a759e5c62f38
BLAKE2b-256 checksum
How to use checksums
dae2284cb8252044efea982f472f98adae5797afdd5081e48d510bf6e627e710
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / rustypaper-0.2.4-cp39-abi3-win_amd64.whl

Download URL rustypaper-0.2.4-cp39-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8e33925da6bc9057550a13156bead229bea92b329ba8c7b15824169b41c204d1
BLAKE2b-256 checksum
How to use checksums
57aae22cfb4e6fc5805609f65c3816514b9e8d6aa4db727ee22568b9e5b74aa6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / rustypaper-0.2.4-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL rustypaper-0.2.4-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.6 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d331c1223f02fb04776cf099c3e5ac0ac76ddbc65c562404357e8215efdb1a63
BLAKE2b-256 checksum
How to use checksums
9a9480f8760d78a261a83fd06df88e6acb3768f0c0817f5e55b5b303b065f7a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / rustypaper-0.2.4-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL rustypaper-0.2.4-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.5 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
4c1ecdc5b88a95710b7ea5e48f793a3f2036fd65e0be848d6588e476dc0d361f
BLAKE2b-256 checksum
How to use checksums
e6a6fe6cccabc117d76d3c7bd005e2932fa98309e58dcdf6eba9fbc989440c37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / rustypaper-0.2.4-cp39-abi3-macosx_11_0_arm64.whl

Download URL rustypaper-0.2.4-cp39-abi3-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
83091f24603eea537b32b8e0158da1f899cb2e2e82d2b21037c9c76eed2e4ff4
BLAKE2b-256 checksum
How to use checksums
7e0cd2782d9e14aac8dea293798fd3501f1aa147aceb8c4802493e1773c1ff4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / rustypaper-0.2.4-cp39-abi3-macosx_10_12_x86_64.whl

Download URL rustypaper-0.2.4-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.5 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c14880fbfdfa5b69ca3a695a9d8d15a19718c2b088627d3bef125a47f07c26dc
BLAKE2b-256 checksum
How to use checksums
085d43401b00d075d62a301170fc2c24778d683d44a409538fdef96d49096706
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Security for rustypaper 0.2.4

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for rustypaper-0.2.4.tar.gz

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 Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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