WolfPPT - Documentation
Which WolfPPT Python APIs work in the published 0.1.6 package?
The public 0.1.6 package exposes Presentation, slide and shape collections, text edits, tables, chart replacement, and slide lifecycle operations used in these docs. This is a reference for the exercised subset, not an exhaustive index of current repository exports or a full python-pptx compatibility guarantee.
Last updated: November 9, 2026.
Load and save a presentation
Presentation(path=None) constructs the facade. Omit path to use the bundled default presentation, or provide an existing PPTX path. A binary file-like object is also accepted. Save with save(path), where the destination can be a path or a binary writable stream. Wrap raw in-memory bytes in BytesIO rather than passing a bytes value as though it were a filename.
The sample creates a slide and text box, saves into a BytesIO object, rewinds it, and opens that stream again. Seeking matters because writing leaves the stream cursor after the package bytes. This is a package round trip, not a native-rendering workflow. No Commercial add-on, helper namespace, or optional chart-data dependency is needed for this example.
Collections and shape selection
Access prs.slides and slide.shapes through iteration or indexing. Enumerate slides to associate an index with each slide, and inspect shape.shape_id and shape.name before choosing a target in a user-supplied template. Use shape.has_text_frame, shape.has_table, and shape.has_chart to decide which content API to read. Collection order and visible role are different facts.
For text-capable shapes, shape.text is the whole text value; shape.text_frame.paragraphs exposes paragraphs and paragraph.runs exposes runs. Assign run.text when changing an existing formatted run. For a table shape, shape.table.cell(row, column).text selects a cell with zero-based coordinates. For a chart shape, shape.chart.replace_data(chart_data) accepts the category chart-data object exercised in the editing topic.
Complete example
from io import BytesIO
from wolfppt import Presentation
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6])
box = slide.shapes.add_textbox(914400, 914400, 3657600, 914400)
box.text = "API example"
stream = BytesIO()
prs.save(stream)
stream.seek(0)
reopened = Presentation(stream)
assert reopened.slides[0].shapes[0].text == "API example"
print(len(reopened.slides))Slide and layout operations
prs.slides.add_slide(layout) takes a layout belonging to the presentation and returns a slide. prs.slides.duplicate(source) appends a same-presentation copy and returns it. prs.slides.move(old_index, new_index) moves a slide within the collection. prs.slides.remove(slide) removes the selected slide object. Layouts and placeholders need inspection before use because their positions vary with the source template.
The slides topic saves and reopens between duplication, movement, and removal. That sequence was executed against 0.1.6. Combining those operations into one pending save failed on the synthetic example, so this reference does not present that combination as supported in the published release. Current source may have a wider surface, but a signature alone is not evidence for that behavior on PyPI.
Versioned namespaces and dimensions
All geometry shown here uses EMUs directly: 914400 is one inch. The published 0.1.6 wheel inspected for this documentation does not contain wolfppt.util, wolfppt.enum, or wolfppt.chart. Avoid imports from those namespaces when using these examples. The chart topic imports compatible helper objects from an explicitly installed python-pptx release instead.
Use this reference to identify the calls a script actually makes, then qualify those calls against your installed version and representative deck. Public names and readable properties are not interchangeable with behavior, preservation, or rendering proof. Separate Commercial reporting and rendering APIs have different requirements and are documented in their own topics rather than being included as if they were Community methods.
Evaluation boundary
The table below records the argument meanings used in the examples. It intentionally avoids listing unexercised optional parameters. Where you need a call outside this subset, consult the source and compatibility entry for the installed release and write a focused saved-output check before adding it to your migration plan.
Parameters and contracts
| API or parameter | Meaning |
|---|---|
Presentation(path=None) | Omitted path creates the default deck; a path or binary stream opens a package. |
save(path) | Write to a path or binary writable stream. |
add_textbox(left, top, width, height) | Create a text box using integer EMU geometry. |
table.cell(row, column) | Select a cell by zero-based row and column. |
slides.move(old_index, new_index) | Move by collection positions, not shape IDs. |
slides.duplicate(source) / remove(slide) | Accept slide objects from the owning presentation. |
What it does not do
- This reference does not enumerate every current-source export.
- Private XML mutation is not covered by the verified examples.
- The chart example needs separately installed python-pptx helper objects.
- No Commercial or Runtime APIs are implied by an available Community import.