Create, edit, and automate PowerPoint presentations with python-pptx for slides, layouts, charts, and batch processing.
User needs to create or modify PowerPoint (.pptx) files programmatically. Agent handles slide creation, content population, chart generation, and template automation.
| Topic | File |
|---|---|
| Slide patterns | slides.md |
| Charts and tables | charts.md |
| Design guidelines | design.md |
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.text import PP_ALIGN
from pptx.dml.color import RgbColor
Install:
pip install python-pptx# Create new presentation
prs = Presentation()
# Or load existing template
prs = Presentation('template.pptx')
# Add slide with layout
slide_layout = prs.slide_layouts[1] # Title and Content
slide = prs.slides.add_slide(slide_layout)
# Save
prs.save('output.pptx')
| Index | Layout Name | Use Case |
|---|---|---|
| 0 | Title Slide | Opening slide |
| 1 | Title and Content | Standard content |
| 2 | Section Header | Chapter dividers |
| 3 | Two Content | Side-by-side |
| 4 | Comparison | Before/after |
| 5 | Title Only | Custom content |
| 6 | Blank | Full control |
# Access title
title = slide.shapes.title
title.text = "Slide Title"
# Access body placeholder
body = slide.placeholders[1]
tf = body.text_frame
tf.text = "First paragraph"
# Add more paragraphs
p = tf.add_paragraph()
p.text = "Second paragraph"
p.level = 1 # Indent level
After creating presentation:
prs.slide_layouts first.slide.shapes iteration to find shapes.Inches() or Pt(). Default sizing can be unpredictable.This skill ONLY:
This skill NEVER:
Data that stays local:
This skill does NOT:
Install with clawhub install <slug> if user confirms:
excel-xlsx — spreadsheet automationword-docx — document generationreport — structured report creationdocuments — document managementclawhub star powerpoint-pptxclawhub sync