WolfSuiteWolfXLWolfPPTWolfDocx

WolfPPT - chart data edits

Update chart data in an existing PowerPoint deck with Python

Point an existing chart at new numbers and keep its styling. WolfPPT accepts the same chart data objects python-pptx uses, rewrites the chart's series and categories, and refreshes the embedded workbook so the data behind the chart matches what the slide shows.

Replace a category chart's data

from pptx.chart.data import CategoryChartData
from wolfppt import Presentation

prs = Presentation("revenue_review.pptx")
chart = next(s for s in prs.slides[0].shapes if s.has_chart).chart

data = CategoryChartData()
data.categories = ["Q1", "Q2", "Q3"]
data.add_series("Revenue", (3.1, 3.8, 4.2))
chart.replace_data(data)
prs.save("revenue_review_updated.pptx")

The saved copy changes two package parts: the chart XML and its embedded workbook. Series may be added or removed. XyChartData and BubbleChartData work the same way for scatter and bubble charts.

When to use WolfPPT and when to use python-pptx

  • Use WolfPPT when the chart already sits in a styled deck and a pipeline should swap its data while the rest of the file keeps its original bytes.
  • Use python-pptx alone when you are building charts in a new deck, or need a chart API the WolfPPT facade does not list yet.
  • The chart data classes come from python-pptx, so install both packages for this task: pip install wolfppt python-pptx.

Limitations

  • Data replacement covers category, XY, and bubble charts.
  • Replacing data with zero series mirrors python-pptx, but the result can fail strict Open XML validation.
  • Mutation guards refuse unsafe edits instead of writing them.

Review the WolfPPT compatibility matrix

Install WolfPPT

The public WolfPPT release is MIT-licensed and free, including commercial use.

pip install wolfppt

PyPI 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