WolfPPT - Documentation

# How do I open, inspect, edit, and save a PPTX with WolfPPT?

Open a deck with Presentation(path), inspect its slides and shapes, make a supported edit, and save to a new path. This quickstart includes its own input deck and reopens the output, so it runs without a pre-existing template.

Last updated: November 9, 2026.

[WolfPPT documentation](https://wolfppt.com/docs)

## Start from a known input

Install wolfppt==0.1.6 before running the script. The first block constructs a synthetic deck with one text box on the default blank layout, then saves review.pptx. Creating the source in the example makes the shape index predictable. In a real template, inspect identities before selecting an object instead of assuming that shapes\[0\] is the title or that slide order never changes.

The blank layout at index six belongs to the bundled default presentation used by this example. It is not a universal layout index for company templates. Open your own file with Presentation("your-template.pptx") and inspect slide_layouts if you need to add a slide there. The slides and layouts documentation shows how to print names and placeholder identifiers before making structural changes.

## Inspect first, then select the target

The second block opens the saved source and prints each zero-based slide index, shape_id, and name. The has_text_frame flag separates text-capable shapes from other objects before accessing their text. Tables and charts have their own flags and APIs. A slide can contain more than the visible title and body, so avoid treating every shape as a plain text box.

The assignment replaces the complete text of the one synthetic box. That is appropriate because this example has no mixed formatting to retain. When your intended change is one value inside a styled paragraph, edit the matching run instead. A token may be split across runs, so the simple replacement loop in the editing topic deliberately states that limitation rather than promising arbitrary placeholder expansion.

## Complete example

```
from wolfppt import Presentation

# Create a reproducible input. Use your own template in production.
seed = Presentation()
slide = seed.slides.add_slide(seed.slide_layouts[6])
slide.shapes.add_textbox(0, 0, 3657600, 914400).text = "Draft review"
seed.save("review.pptx")

prs = Presentation("review.pptx")
for slide_index, slide in enumerate(prs.slides):
    for shape in slide.shapes:
        print(slide_index, shape.shape_id, shape.name)
        if shape.has_text_frame:
            print(shape.text)
prs.slides[0].shapes[0].text = "Approved review"
prs.save("review-updated.pptx")
assert Presentation("review-updated.pptx").slides[0].shapes[0].text == "Approved review"
```

## Save a distinct output and reopen it

The source and destination have different names. The script writes review-updated.pptx, opens that saved package, and asserts the expected text. This catches the narrow failure in which an in-memory assignment appears correct but is absent from the file you hand to another process. The assertion proves the named text result, not that every unrelated feature has been independently qualified.

For your first real template, also make a no-op copy before editing anything. Compare ZIP member inventories and member bytes, then apply one controlled change and review the affected parts. The migration and limits topic includes a small comparison script. Keep semantic checking, preservation checking, schema validation, and visual review as distinct questions with distinct evidence.

## Use geometry and outputs deliberately

Text box bounds in the sample are integer English Metric Units. One inch is 914400 EMUs. The example does not import wolfppt.util because that namespace is absent from the public 0.1.6 package checked here. Using integer bounds also makes it clear that editing the package does not invoke a layout engine that automatically chooses a suitable box size for your content.

Run this script in a working directory where its output names are safe to write. For application code, choose explicit input and output locations and decide how publication should work before integrating a batch job. If you need source hashes, expected old-value guards, staged verification, and refusal before publication, use the separate Commercial reporting surface instead of assuming an ordinary save is that reporting transaction.

## Evaluation boundary

Treat the synthetic source creation as demonstration setup, not a recommendation to recreate a customer presentation before editing it. For an existing template, open the original package directly and restrict changes to the approved objects. Keep the original until your saved-output checks pass, and distinguish a new artifact from permission to send or publish that artifact.

## What it does not do

- Whole-box text replacement is not a promise to preserve mixed run formatting.
- Reopening text is not a PDF render, font-fit check, or schema-validation result.
- The sample selects an index only because it created the source itself.
- This package-only quickstart needs no Commercial modules and does not render slides.

## Related documentation and tasks

- [Which WolfPPT Python APIs work in the published 0.1.6 package?](https://wolfppt.com/docs/api-reference)
- [How do I edit PPTX text, table cells, and chart data with WolfPPT?](https://wolfppt.com/docs/text-tables-charts)
- [How do I refresh a PPTX report and handle WolfPPT refusals?](https://wolfppt.com/docs/reports-refusals)
- [Update an existing PPTX](https://wolfppt.com/update-pptx-python)
- [Update PPTX table cells](https://wolfppt.com/update-pptx-table-python)
