pptx
БесплатноЗапускает вложенные скриптыНе проверенPowerPoint presentation generation using python-pptx. Create slides from Claude output, data analysis, or structured content. Covers slide templates, shapes…
от oimiragieo★ 48 звёзд на GitHubОб этом скилле
PowerPoint Generation (pptx)
Overview
Generate .pptx files programmatically using python-pptx. Convert Claude output, data analysis results, research reports, and structured data into polished PowerPoint presentations.
When to Invoke
Skill({ skill: 'pptx' }) when:
- User asks to "create a presentation", "generate slides", or "make a PowerPoint"
- Converting a report, analysis, or structured document into slide format
- Generating recurring report slides from data
- Creating template-based presentations programmatically
Installation
pip install python-pptx
# or
uv add python-pptx
Quick Start
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.enum.text import PP_ALIGN
from pptx.dml.color import RGBColor
# Create presentation
prs = Presentation()
# Set slide dimensions (widescreen 16:9)
prs.slide_width = Inches(13.33)
prs.slide_height = Inches(7.5)
# Add title slide using layout 0
title_layout = prs.slide_layouts[0]
slide = prs.slides.add_slide(title_layout)
title = slide.shapes.title
subtitle = slide.placeholders[1]
title.text = "Q1 2026 Business Review"
subtitle.text = "Prepared by Claude Agent"
# Add content slide using layout 1 (title + content)
content_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(content_layout)
slide.shapes.title.text = "Key Findings"
tf = slide.placeholders[1].text_frame
tf.text = "Revenue grew 23% YoY"
p = tf.add_paragraph()
p.text = "Customer retention at 94%"
p.level = 1 # Indent level
prs.save("presentation.pptx")
Slide Layouts Reference
Standard layouts available in default template:
| Index | Name | Use For |
|---|---|---|
| 0 | Title Slide | Opening slide |
| 1 | Title and Content | Main content slides |
| 2 | Title and Two Content | Side-by-side comparison |
| 5 | Title Only | Charts or images with title |
| 6 | Blank | Custom layouts |
# List all layouts in a template
for i, layout in enumerate(prs.slide_layouts):
print(f"{i}: {layout.name}")
Text Formatting
from pptx.util import Pt
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN
def format_paragraph(paragraph, text, size=18, bold=False, color=None, align=PP_ALIGN.LEFT):
run = paragraph.add_run()
run.text = text
font = run.font
font.size = Pt(size)
font.bold = bold
if color:
font.color.rgb = RGBColor(*color) # e.g., (0x1F, 0x49, 0x7D) for dark blue
paragraph.alignment = align
return run
# Usage
tf = slide.placeholders[1].text_frame
tf.clear() # Clear existing content
p = tf.paragraphs[0]
format_paragraph(p, "Important Metric: 94%", size=24, bold=True, color=(0x1F, 0x49, 0x7D))
Tables
from pptx.util import Inches
def add_table_slide(prs, title, headers, rows):
"""Add a slide with a formatted table."""
slide = prs.slides.add_slide(prs.slide_layouts[5]) # Title Only
slide.shapes.title.text = title
# Position: left, top, width, height
left = Inches(0.5)
top = Inches(1.5)
width = Inches(12.3)
height = Inches(0.8 * (len(rows) + 1))
table = slide.shapes.add_table(
len(rows) + 1, len(headers), left, top, width, height
).table
# Header row
for col_idx, header in enumerate(headers):
cell = table.cell(0, col_idx)
cell.text = header
cell.text_frame.paragraphs[0].runs[0].font.bold = True
# Data rows
for row_idx, row in enumerate(rows):
for col_idx, value in enumerate(row):
table.cell(row_idx + 1, col_idx).text = str(value)
return slide
# Usage
headers = ["Product", "Revenue", "Growth"]
rows = [
("Widget A", "$1.2M", "+23%"),
("Widget B", "$890K", "+15%"),
("Widget C", "$450K", "-5%"),
]
add_table_slide(prs, "Revenue by Product", headers, rows)
Charts
from pptx.chart.data import ChartData
from pptx.enum.chart import XL_CHART_TYPE
from pptx.util import Inches
def add_bar_chart(slide, title, categories, series_name, values):
"""Add a bar chart to a slide."""
chart_data = ChartData()
chart_data.categories = categories
chart_data.add_series(series_name, values)
chart = slide.shapes.add_chart(
XL_CHART_TYPE.COLUMN_CLUSTERED,
Inches(1), Inches(1.5), # left, top
Inches(11), Inches(5.5), # width, height
chart_data
).chart
chart.has_title = True
chart.chart_title.text_frame.text = title
chart.has_legend = False
return chart
# Usage
slide = prs.slides.add_slide(prs.slide_layouts[5])
slide.shapes.title.text = "Monthly Revenue"
add_bar_chart(
slide,
"Revenue by Month (2026)",
["Jan", "Feb", "Mar"],
"Revenue ($K)",
(450, 520, 610)
)
Images
from pptx.util import Inches
def add_im
Установить pptx в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteEditВложенные файлы
FAQ
Что делает скилл pptx?
PowerPoint presentation generation using python-pptx. Create slides from Claude output, data analysis, or structured content. Covers slide templates, shapes, charts, tables, and themed presentations. Use for generating .pptx files programmatically.
Как установить скилл pptx?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pptx запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic