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.3

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.3
File Size Uploaded Provenance Actions
rustypaper-0.2.3.tar.gz 179.7 kB With provenance Details for rustypaper-0.2.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rustypaper 0.2.3
File Actions
rustypaper-0.2.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for rustypaper-0.2.3-cp39-abi3-win_amd64.whl
rustypaper-0.2.3-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.3-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
rustypaper-0.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for rustypaper-0.2.3-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
rustypaper-0.2.3-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for rustypaper-0.2.3-cp39-abi3-macosx_11_0_arm64.whl
rustypaper-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for rustypaper-0.2.3-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 7.5 MB

Release files / rustypaper-0.2.3.tar.gz

Download URL rustypaper-0.2.3.tar.gz
Size 179.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d8509473284a4b657963aa3c7ffd8522d691361b0c40c2840f6ccd79548a18c8
BLAKE2b-256 checksum
How to use checksums
d128b5b96d7ca952dab09c7db129dad6bc1a1a157b698dcb697ca821d8725b0e
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 14, 2026.

Transparency log

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

Download URL rustypaper-0.2.3-cp39-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3a5fd09b8e15b66da8d2bdb70585362de92183151a0413164f0a4da159597550
BLAKE2b-256 checksum
How to use checksums
3e39c14407b49706eb79fd20bd0dc3cd71ddb133046d2d013c67a18e463e65ed
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 14, 2026.

Transparency log

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

Download URL rustypaper-0.2.3-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
380146e7463545728c26be02f9632f87e054f9dabca7275d0555d5f1aef58386
BLAKE2b-256 checksum
How to use checksums
134c8df033fea4bb1e9441190b21da1f8c0e9181189dd63aac54c7e27560bdd7
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 14, 2026.

Transparency log

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

Download URL rustypaper-0.2.3-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
6c9f36fe86f95dcbe5a4e09060b3f2e23e7607069a91036b8b5976ab11913bdd
BLAKE2b-256 checksum
How to use checksums
f1987638fa18a72331fb66cdb77d593f3b8012be282b527f2bc4ea3ad2bf1374
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 14, 2026.

Transparency log

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

Download URL rustypaper-0.2.3-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
2b2fbf6017ae1a9d1713165add8b97e3c28588bd836d9c230c15116b60235407
BLAKE2b-256 checksum
How to use checksums
c944fab217ccfc6c164a316ecb5927b1640d2db7017e1551184b035094096ff5
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 14, 2026.

Transparency log

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

Download URL rustypaper-0.2.3-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
0ffb5468b659c863da056a65c870038068a915920adbbf3555dfce77661d46c3
BLAKE2b-256 checksum
How to use checksums
83e5d17855755774cc10b2add64c2ce4271d5537951e211abfa78c53e8119053
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 14, 2026.

Transparency log

Security for rustypaper 0.2.3

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.3.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 14, 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