website/docs/user-guide/skills/bundled/productivity/productivity-powerpoint.md
Create, read, edit .pptx decks with python-pptx.
| Source | Bundled (installed by default) |
| Path | skills/productivity/powerpoint |
| Version | 1.0.0 |
| Author | Nous Research |
| License | MIT |
| Platforms | linux, macos, windows |
| Tags | pptx, powerpoint, presentations, slides, office, python-pptx |
| Related skills | docx, xlsx, pdf |
:::info The following is the complete skill definition that Hermes loads when this skill is triggered. This is what the agent sees as instructions when the skill is active. :::
Create, inspect, and edit PowerPoint (.pptx) presentations using the python-pptx library. Four helper scripts cover deck creation from a JSON spec, structured read-back, in-place edits, and template-driven brand decks — all offline, no PowerPoint installation required.
soffice --convert-to pptx old.ppt if LibreOffice is available.python-pptx installed
(pip install python-pptx). Pillow is optional (only if you need to
probe image dimensions yourself).soffice) for rendering slides to images for
visual verification. Degrade gracefully if absent — all create/read/edit
operations work without it.terminal:
python3 -c "import pptx; print(pptx.__version__)" and which soffice.All scripts live in scripts/, take --help, print JSON to stdout, and
exit non-zero on failure. Run them with terminal:
python3 scripts/pptx_create.py deck.json out.pptx
python3 scripts/pptx_read.py deck.pptx --outline # full JSON outline
python3 scripts/pptx_read.py deck.pptx --notes # speaker notes
python3 scripts/pptx_read.py deck.pptx --images ./img # export pictures
python3 scripts/pptx_edit.py deck.pptx --replace-text "Old Corp" "New Corp"
python3 scripts/pptx_edit.py deck.pptx --chart-data update.json
python3 scripts/pptx_edit.py deck.pptx --remove-slide 3 --move-slide 2 0
python3 scripts/pptx_from_template.py brand.pptx out.pptx --values vals.json
Author JSON specs with write_file; inspect script output and generated
JSON with read_file.
| Task | Command |
|---|---|
| New deck from spec | pptx_create.py spec.json out.pptx |
| 16:9 vs 4:3 | "slide_size": "16:9" or "4:3" in the spec |
| Outline as JSON | pptx_read.py deck.pptx --outline |
| Export images | pptx_read.py deck.pptx --images DIR |
| Replace text | pptx_edit.py deck.pptx --replace-text OLD NEW |
| Update chart | pptx_edit.py deck.pptx --chart-data spec.json |
| Swap picture | pptx_edit.py deck.pptx --swap-image N NAME new.png |
| Remove slide | pptx_edit.py deck.pptx --remove-slide N |
| Reorder slide | pptx_edit.py deck.pptx --move-slide FROM TO |
| Fill template | pptx_from_template.py tpl.pptx out.pptx --values v.json |
Write a JSON spec (see pptx_create.py --help for the full format), then
run pptx_create.py. Per slide you can set: layout (title,
title_content, section, two_content, title_only, blank), title,
subtitle, bullets (strings, or dicts with level 0-4, size pt,
bold, italic, font, color hex), images (path + left/top/width/
height in inches), tables (rows as list-of-lists), shapes
(rectangle, rounded_rectangle, oval, diamond, right_arrow, chevron, with
fill hex + optional text), charts (bar, bar_h, line, pie with
categories + series), and notes (speaker notes).
pptx_read.py deck.pptx --outline returns slide size, layout inventory,
and per slide: layout name, all shape texts, table cells, image inventory
(filename/ext/bytes), chart categories/series/values, and speaker notes.
Use --images DIR to dump embedded pictures to files, then
vision_analyze on any exported image if you need to see its content.
pptx_edit.py combines operations in one pass; use --output to keep the
original. Text replacement scans slide shapes, table cells, and notes.
Chart update uses chart.replace_data() with a JSON spec naming the
slide/chart index and new categories/series. Image swap retargets the
picture's relationship id so position and size are preserved. Slide
removal drops the relationship and the <p:sldId> entry; reorder moves
the <p:sldId> element within <p:sldIdLst> (python-pptx has no public
API for either — the script does the XML-level work).
pptx_from_template.py opens a brand .pptx, replaces every
{{token}} from a values JSON across slides/tables/notes, and can append
new slides that use the template's own layouts (by layout name or index)
so they inherit the master's fonts and colors. Tip: to start from a
template with zero slides, delete existing ones afterward with
pptx_edit.py --remove-slide.
If soffice exists, render slides to PNG and inspect with
vision_analyze:
soffice --headless --convert-to png --outdir ./render deck.pptx # slide 1
soffice --headless --convert-to pdf --outdir ./render deck.pptx # all slides
PNG export renders only the first slide; convert to PDF for all slides
(then pdftoppm -png render/deck.pdf render/slide if poppler is
available). When soffice is absent, rely on the JSON outline from
pptx_read.py — it verifies content and structure, just not visuals.
--replace-text
preserves formatting exactly when a match lies within one run; when the
match spans runs, the paragraph is rewritten with only the first run's
formatting. Verify important slides after replacement.--move-slide manipulates <p:sldIdLst> directly; it is safe for
ordinary decks but re-read the deck afterward to confirm.pptx_read.py template.pptx --outline (layouts_available).slide.shapes.title is None on blank layouts — the create script
handles this, but remember it when writing ad-hoc python-pptx code.encoding="utf-8" when writing spec files; tokens like
{{city}} may be filled with non-ASCII values.pptx_read.py OUT.pptx --outline and check
slide count, texts, tables, notes, and chart values match intent.--images DIR then file-size check confirms pictures embedded.soffice (see Procedure step 5) and
review each slide image with vision_analyze.python3 -m pytest tests/ -q (requires python-pptx + pytest).