# PPTX

Read, create, or edit PowerPoint .pptx decks, build slides from an outline, extract...

- Repository: https://github.com/HKUDS/DeepTutor (53613 stars)
- Category: Documents
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add HKUDS/DeepTutor --skill pptx -g -a claude-code -y`
Codex: `npx skills add HKUDS/DeepTutor --skill pptx -g -a codex -y`
Cursor: `npx skills add HKUDS/DeepTutor --skill pptx -g -a cursor -y`
Gemini CLI: `npx skills add HKUDS/DeepTutor --skill pptx -g -a gemini-cli -y`

## Description

Read, create, or edit PowerPoint .pptx decks, build slides from an outline, extract slide text/speaker notes, edit shapes/tables/charts, replace images, or export to PDF/images. Use whenever a .pptx (or .ppt) file is an input or output, or the user mentions a deck, slides, or a presentation.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# pptx

Work with PowerPoint `.pptx` files using **python-pptx** (preinstalled). A `.pptx`
is a ZIP of XML parts; python-pptx handles the structure so you rarely touch XML.
Drop to raw OOXML only for the few things the library can't express (see Advanced).

Use `exec` with complete Python source (`language: python`). Keep asset creation,
deck generation, reopening, and structural verification in one call when
possible; later calls can revise the same relative filename. Follow the turn's
**User workspace** instructions for locating inputs, output boundaries, and
presenting the finished deck.

## Mental model
- A presentation has **slides**; each slide is built from a **layout**; layouts
  live on **slide masters**. Layouts define **placeholders** (title, body,
  picture, etc.) by `idx` and type.
- A slide holds **shapes**: placeholders, text boxes, pictures, tables, charts.
- Shapes with text expose `.text_frame` → `.paragraphs` → `.runs`. A run is the
  unit that carries formatting (font, size, bold, color).
- Units are EMU. Use the helpers: `from pptx.util import Inches, Pt, Emu`.

## Read / extract
```python
from pptx import Presentation

prs = Presentation("deck.pptx")
print(len(prs.slides), prs.slide_width, prs.slide_height)  # EMU dims

for i, slide in enumerate(prs.slides, 1):
    print(f"--- slide {i} (layout: {slide.slide_layout.name}) ---")
    for shape in slide.shapes:
        if shape.has_text_frame:
            print(shape.text_frame.text)  # \n-joined paragraphs
        elif shape.has_table:
            for row in shape.table.rows:
                print([c.text for c in row.cells])
    if slide.has_notes_slide:
        notes = slide.notes_slide.notes_text_frame.text
        if notes:
            print("NOTES:", notes)
```
Iterate `slide.placeholders` to see placeholder `idx` / `placeholder_format.type`.
For a fast text-only dump, just collect `shape.text_frame.text` across slides.

The rest: https://github.com/HKUDS/DeepTutor/blob/HEAD/deeptutor/skills/builtin/pptx/SKILL.md
