Paper Office
paper-pptx

paper-pptx

A python-pptx fork for working with PowerPoint files without changing your imports.

paper-pptx is a fork of python-pptx for working with PowerPoint presentations. It keeps the pptx import name and the python-pptx object model, so existing code works unchanged. It adds resolved formatting, relationship-safe slide operations, cross-deck composition, and structural diffs. When a mutation cannot be made safely, it raises a typed error and leaves the presentation unchanged.

from pptx import Presentation          # the import name is unchanged

Quick start

pip uninstall -y python-pptx paper-pptx
pip install paper-pptx
paper-pptx-doctor                          # paper-pptx-doctor: OK (paper-pptx 0.2.0)
from pptx import Presentation
from pptx.diff import diff_decks
from pptx.edit import replace_text

prs = Presentation("deck.pptx")

run = prs.slides[0].shapes.title.text_frame.paragraphs[0].runs[0]
font = run.effective_font()
print(font.size.value_pt)              # resolved through layout/master/theme, e.g. 36.0

replace_text(prs, "FY25", "FY26")      # untouched runs keep their formatting
prs.save("deck.v2.pptx")               # atomic: the old file survives a failed save

delta = diff_decks("deck.pptx", "deck.v2.pptx", detail="text")
print(len(delta.slide_changes), "slides changed")

Compatibility

  • PyPI distribution and GitHub repository: paper-pptx
  • Python import: pptx. Never import paper_pptx.
  • Upstream compatibility version: pptx.__version__ == "1.0.2"
  • Fork version: pptx.__paper_version__ (currently "0.2.0")

import pptx raises ImportError when both python-pptx and paper-pptx metadata are installed. Upstream's pytest and behave suites run on every change, and upstream releases are merged, not rebased. Requires Python 3.9+.

On this page