Compare
pptxboss vs python-pptx.
Both read PowerPoint files from Python. python-pptx is the pure-Python library most people start with, and the only one of the two that edits an existing deck. pptxboss is written from scratch in Rust, reads more of the file, verifies it, opens legacy .ppt decks, and is 16 to 20 times faster on the reading path. Here is where each one stands, gaps included.
| pptxboss | python-pptx | |
|---|---|---|
| License | MIT OR Apache-2.0 | MIT |
| Engine | Written from scratch in safe Rust; no C dependencies | Pure Python on top of lxml |
| Text extraction | 9,868 files/s on all cores, 7,942 on one thread | 488 files/s (631 test-suite decks, same machine) |
| Formats | .pptx, Strict and Transitional, and legacy .ppt | .pptx (PowerPoint 2007 and later) |
| Speaker notes, tables, pictures, hyperlinks | Read | Read and write |
| Charts | Cached titles, series, categories and values read with the slide text | Read and create through the chart API |
| Comments, sections, SmartArt text | Read | Not exposed |
| Embedded objects | Listed with prog_id and part; bytes on request | OLE objects through the graphic frame's ole_format |
| Markdown output | pptxboss markdown and Document.markdown() | None |
| Verification | 72 clause-numbered ECMA-376 rules with stable codes | None |
| Creating decks | Titles, bullets, paragraphs, text boxes, tables, pictures, notes; Markdown to slides; from Rust or the CLI | Full object model from Python |
| Editing existing decks | No | Yes |
| Reporting | Every skipped item returned with the text | Exceptions |
Throughput rows come from the pptxboss benchmark harness, where python-pptx is also the reference every pptxboss paragraph is compared against. Feature statements about python-pptx are from its own documentation.
Migration
The reading path, side by side.
Documents index like lists in pptxboss and slides parse lazily. slide.text() walks shapes in z-order, descends groups and includes table rows, so the shape loop disappears; slide.notes() returns the notes or None.
from pptx import Presentation
prs = Presentation("deck.pptx")
for slide in prs.slides:
for shape in slide.shapes:
if shape.has_text_frame:
print(shape.text_frame.text)
if slide.has_notes_slide:
print(slide.notes_slide.notes_text_frame.text)import pptxboss
doc = pptxboss.Document("deck.pptx")
for slide in doc:
print(slide.text())
print(slide.notes())
text, warnings = doc.text_reporting()Where python-pptx is ahead
What python-pptx does that pptxboss does not.
- Edits an existing deck: add or remove slides, change text, insert pictures, build charts, and save the result. pptxboss creates new decks only, and only from Rust or the CLI.
- A full Python object model for creating presentations, with placeholders, layouts, shapes and chart types.
Where pptxboss is ahead
What pptxboss does that python-pptx does not.
- Speed on the read path: 16 to 20 times faster over the measured corpus, with paragraph-for-paragraph agreement on every file.
- Legacy .ppt decks through the same API.
- Comments with authors and replies, sections, application properties and SmartArt text.
- Strict-namespace decks, which python-pptx cannot open (86 of the 737 corpus files).
- Markdown output, a verifier with clause-numbered rules, and a report of everything skipped instead of an exception.
Questions
- Is pptxboss a drop-in replacement for python-pptx?
- No. The APIs differ and the scopes differ: python-pptx creates, reads and updates .pptx files; pptxboss reads and verifies .pptx and .ppt decks from Python and creates new decks from Rust or the CLI, but does not edit an existing file. Migrating the reading path is a few lines per call site.
- Is pptxboss faster than python-pptx?
- On the operation measured, yes: text extraction over 631 public test-suite decks runs 20 times faster on all cores (9,868 against 488 files per second) and 16 times faster on one thread (7,942 files per second), with per-slide paragraphs agreeing on every one of the 636 files that pass the gate.
- Does pptxboss read what python-pptx reads?
- For reading, yes and more: slide text, notes, tables, pictures, hyperlinks, core properties and chart data, plus comments with authors, sections, application properties, SmartArt text and Strict-namespace decks. It also reads PowerPoint 97-2003 .ppt files, which python-pptx does not open.
- Does pptxboss need any native library installed?
- No. pptxboss is written from scratch in Rust with its own ZIP, DEFLATE and XML readers, and the wheel has no dependency beyond CPython 3.12 or later. python-pptx is pure Python and depends on lxml.