pptspine
A pure-Rust PowerPoint (.pptx) parser with Python bindings — structural parsing plus faithful .pptx → PDF export. Apache-2.0, on PyPI.
A pure-Rust PowerPoint (.pptx) parser with Python bindings — now with faithful .pptx → PDF export.
A .pptx file is OOXML: a zip archive of XML parts. pptspine walks that XML
directly to produce a structured, information-preserving model of a deck —
slides, text frames (paragraphs + styled runs), tables (cells, merges, fills),
pictures, and autoshapes. As of v0.2.0 it also renders a deck to PDF. It
ships as an abi3-py311 wheel under Apache-2.0; the only runtime dependency
is ocrspine-models.
pip install pptspineCapabilities
- Structural parsing. Open a deck from a path or bytes, walk its slides and
shapes, and read text frames, tables, pictures, and speaker notes. Convert the
whole deck to plain text or Markdown with
to_text()/to_markdown(). .pptx → PDFexport.Presentation.to_pdf()renders one PDF page per slide at the exact slide size, resolving the slideLayout / slideMaster / theme inheritance chain so placeholder text looks like it does in PowerPoint.- Local OCR. Embedded images can be OCR'd offline and deterministically via
the sibling
ocrspineengine (PP-OCRv5 throughtract-onnx) — no cloud, no network.
PDF export in two lines
import pptspine
pres = pptspine.open("deck.pptx")
pres.save_pdf("deck.pdf") # one PDF page per slideShared typesetting engine
PDF export is built on pdf-typeset, a first-party Rust typesetting engine
that lives in the pdfspine workspace and backs both pptspine's and
docspine's → PDF export. It is a self-authored,
deterministic layout engine — not an HTML/CSS or Story engine. Output is
text-extractable (a ToUnicode map is always written) and deterministic per
font environment.
The Spine family
pptspine is one of three document-processing packages that share this typesetting core:
| Package | Handles | On this site |
|---|---|---|
| pdfspine | PDF read / edit / render, plus Markdown → PDF | Introduction |
| docspine | .docx → model / PDF | docspine |
| pptspine | .pptx → model / PDF | you are here |
All three are Apache-2.0, pure-Rust, abi3-py311 wheels installable with a
single pip install.
Benchmarks
Reproducible accuracy benchmarks for pdfspine's text extraction, rendering, and OCR, measured against objective ground truth and the PyMuPDF, pypdfium2, and pdfminer.six reference engines.
PDF export
Render a .pptx deck to PDF with Presentation.to_pdf and save_pdf — one page per slide, font maps, degradation warnings, and the rendering features covered.