Skip to content

Python-native PDF toolkit

PDFs, with Python ergonomics and a Rust core.

Edit, render, extract and finish PDFs through one familiar API—without heavyweight runtime dependencies.

pip install pylopdf
  • MIT licensed
  • ~3.5 MB wheels
  • Zero runtime dependencies
  • Python 3.10–3.14
01 / EDIT

Edit precisely

Merge, select, annotate, fill forms and preserve the structure that matters.

02 / RENDER

Render faithfully

Turn pages into dependable PNG or SVG output with a compact native engine.

03 / EXTRACT

Extract meaning

Read text, words, blocks, geometry and invisible OCR layers through one API.

Useful constraints, visible evidence

Small enough for deployment. Complete enough for real workflows.

pylopdf combines lopdf for editing with hayro—the pure-Rust renderer used by Typst—for an intentionally compact Python package.

~3.5 MB Current wheel size, suited to size-constrained environments such as AWS Lambda.
0 Runtime dependencies. Install one wheel and start processing PDFs.
3.10–3.14 A single abi3 wheel line covers five Python generations.
MIT A permissive license for open-source and commercial products.

Deliberate scope

A focused PDF core that works with the Python ecosystem.

The project publishes reproducible benchmarks—including losses—and uses established tools instead of rebuilding adjacent domains.

Inside pylopdf

  • Page management, metadata, outlines and encryption
  • Positioned text extraction, search and Markdown conversion
  • PNG/SVG rendering, images, annotations and OCR text layers
  • AcroForm filling, attachments and page labels

Connected by design

  • Typesetting and new PDF/A documents with Typst
  • PAdES signatures with pyHanko
  • PDF/A validation with veraPDF
  • Any OCR engine that returns words and rectangles