WolfPPT - python-pptx alternative
A python-pptx alternative for editing existing PowerPoint decks
Keep python-pptx for building decks from code. When a pipeline edits a deck your team already maintains, WolfPPT offers the same Presentation, slides, shapes, text_frame, and runs names and saves a copy where every part you did not edit keeps its original bytes.
The same edit script with one import changed
import zipfile
from wolfppt import Presentation # was: from pptx import Presentation
prs = Presentation("monthly_review.pptx")
for slide in prs.slides:
for shape in slide.shapes:
if not shape.has_text_frame:
continue
for paragraph in shape.text_frame.paragraphs:
for run in paragraph.runs:
if "{{month}}" in run.text:
run.text = run.text.replace("{{month}}", "September")
table = next(s for s in prs.slides[1].shapes if s.has_table).table
table.cell(1, 1).text = "$4.2M"
prs.save("monthly_review_updated.pptx")
with zipfile.ZipFile("monthly_review.pptx") as before, zipfile.ZipFile("monthly_review_updated.pptx") as after:
assert before.namelist() == after.namelist()
print([n for n in before.namelist() if before.read(n) != after.read(n)])
# ['ppt/slides/slide1.xml', 'ppt/slides/slide2.xml']The script replaces a placeholder in each run that holds it, writes a value into a table cell, and saves a new file. The check at the end compares the package before and after: only the two slide parts that hold edits differ, and the part list is identical. Masters, layouts, themes, media, and notes keep their original bytes.
When python-pptx fits
- You generate a new deck from code, from a template of layouts, or from a data set.
- You need a python-pptx call that the WolfPPT facade does not list. The facade covers a documented subset, so check the compatibility matrix for each call your script relies on.
- The saved file does not need to keep unedited parts as they were.
What WolfPPT adds for decks that already exist
- Untouched parts stay untouched. Saving rewrites only the parts that hold your edits. Parts WolfPPT has no schema for, such as vendor extensions, are copied through byte-for-byte.
- Guarded edits. Mutation guards refuse an unsafe edit instead of writing it.
- Familiar names. An existing python-pptx edit script usually needs only its import changed, as in the sample above.
- Free to use. The public WolfPPT release is MIT-licensed, including commercial use.
A published example edits one five-slide board deck with python-pptx and with the wolf command, which is the Wolf runtime and not the WolfPPT Python package. python-pptx rewrote 45 of the deck's 54 package parts, and Wolf rewrote 3. Both result decks are linked, along with the part-by-part list. It is one deck, so test your own files before you rely on it. See the side-by-side example on wolfsdk.com.
Limitations
- A placeholder that PowerPoint split across several runs appears as separate run texts, so the loop above matches a placeholder only when one run holds all of it.
- Setting
shape.textrewrites the whole text body as newline-separated paragraphs. Assignrun.textwhen formatting inside the shape must stay intact. - The public MIT package edits decks and does not render them. To turn a deck into PDF or PNG, see Convert PPTX to PDF in Python.
- Chart edits use python-pptx's chart data classes, so install both packages for that task. See update chart data in an existing deck.
Install WolfPPT
The public WolfPPT release is MIT-licensed and free, including commercial use.
pip install wolfpptPyPI wheels cover CPython 3.11 to 3.14 on Linux x86_64 and aarch64 and on macOS arm64. Source, tests, and the full facade reference live at github.com/wolfiesch/wolfppt-oss.
Related tasks
Cost
WolfPPT has no paid plan. The WolfPPT home page lists the supported tasks, and the pricing page covers the other WolfSDK engines.