API Reference
This reference covers the public API of power-pptx v2.12.0. Everything on the 1.0.2 upstream surface still works; fork additions are markedfork. Theupstream Sphinx docsprovide prose deep-dives; this section is the structured map of the surface.
Top-level package: power_pptx
from power_pptx import (
Presentation, # factory: Presentation() or Presentation("file.pptx")
BBox, # immutable rectangular region; splats into add_* APIs
audit, AuditReport, # one-call deck audit → markdown report
# Figure adapters (lazy third-party deps)
add_plotly_figure, add_matplotlib_figure,
add_svg_figure, add_html_figure, FigureBackendUnavailable,
# Shape-level building blocks (token-driven)
add_kpi_card, add_progress_bar, add_gauge,
add_status_pill, add_stat_strip, add_article_card,
KpiCard, ProgressBar, Gauge, StatusPill, StatStrip, ArticleCard,
)Module map
Presentation & Slides
Presentation factory, slide collection, slide masters/layouts, notes, core properties, transitions, audit().
Shapes & Geometry
BBox, shape tree, autoshapes, pictures, connectors, groups, freeforms, tables, placeholders, diagrams.
Text
TextFrame, paragraphs, runs, fonts, fit_text, TextFitter, auto-size behaviour.
Charts
Chart, plots, series, axes, legends, data labels, chart data, palettes, quick layouts.
Design System
DesignTokens, style facade, Grid/Stack, slide recipes, shape components, figure adapters.
Compose, Lint & Render
from_spec, import_slide, apply_template, slide.lint()/tidy(), audit, thumbnail renderer, animations, theme.
Enumerations
MSO_SHAPE, MSO_AUTO_SIZE, PP_ALIGN, XL_CHART_TYPE, MSO_PATTERN_TYPE and friends.
Reading the signatures
- Lengths are EMU-backed
intsubclasses:Inches,Pt,Cm,Emu,Mmfrompower_pptx.util. - Colours accept hex strings,
(r, g, b)tuples, orRGBColor. - Unset optional properties return
None; assignNoneto clear them. - Exceptions live in
power_pptx.exc— e.g.PackageNotFoundError,CairoSvgUnavailable,ThumbnailRendererUnavailable,FigureBackendUnavailable.