python-pptx-generator
它能做什么
可以生成一份完整的 Python 脚本,用来自动创建 PowerPoint 演示文稿(.pptx)。你给出一个主题,它就会输出一份包含真实内容和合理结构的幻灯片脚本。
适用场景
- ✓你想要一个能生成 .pptx 文件的 Python 脚本时。
- ✓你需要起草幻灯片内容,并直接写进脚本里时。
- ✓你想快速做一个用于演示或课堂的演示文稿生成器时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/python-pptx-generator/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“帮我写一个 Python 脚本,生成一份 5 页的演示文稿,介绍太阳能对房主的好处。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会先理解主题和你想要的演示文稿结构。然后,它会使用 `python-pptx` 库编写 Python 代码,为每一页创建标题和文字,并保存最终文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Python PPTX Generator
Overview
Use this skill when the user wants a ready-to-run Python script that creates a PowerPoint presentation with python-pptx.
It focuses on turning a topic brief into a complete slide deck script with real slide content, sensible structure, and a working save step.
When to Use This Skill
- Use when the user wants a Python script that generates a
.pptxfile automatically - Use when the user needs slide content drafted and encoded directly into
python-pptx - Use when the user wants a quick presentation generator for demos, classes, or internal briefings
How It Works
Step 1: Collect the Deck Brief
Ask for the topic, audience, tone, and target number of slides if the request does not already include them. If constraints are missing, pick conservative defaults and state them in the generated script comments.
Step 2: Plan the Narrative Arc
Outline the deck before writing code:
- Title slide
- Agenda or context
- Core teaching or business points
- Summary or next steps
Keep the slide count realistic for the requested audience and avoid filler slides.
Step 3: Generate the Python Script
Write a complete script that:
- imports
Presentationfrompython-pptx - creates the deck
- selects appropriate built-in layouts
- writes real titles and bullet points
- saves the file with a clear filename
- prints a success message after saving
Step 4: Keep the Output Runnable
The final answer should be a Python code block that can run after installing python-pptx.
Avoid pseudocode, placeholders, or missing imports.
Examples
Example 1: Educational Deck
User: Create a 5-slide presentation on the basics of machine learning for a high school class.
Output: A complete Python script that creates a title slide, overview, core concepts, examples, and recap.
Example 2: Business Briefing
User: Generate a 7-slide deck for sales leadership on Q2 pipeline risks and mitigation options.
Output: A python-pptx script with executive-friendly slide titles, concise bullets, and a final recommendations slide.
Best Practices
- ✅ Use standard
python-pptxlayouts unless the user asks for custom positioning - ✅ Write audience-appropriate bullet points instead of placeholders
- ✅ Save the output file explicitly in the script, for example
output.pptx - ✅ Keep slide titles short and the bullet hierarchy readable
- ❌ Do not return partial snippets that require the user to assemble the rest
- ❌ Do not invent unsupported styling APIs without checking
python-pptxcapabilities
Security & Safety Notes
- Install
python-pptxonly in an environment you control, for example a local virtual environment - If the user will run the script on a shared machine, choose a safe output path and avoid overwriting existing presentations without confirmation
- If the request includes proprietary or sensitive presentation content, keep it out of public examples and sample filenames
Common Pitfalls
Problem: The generated script uses placeholder text instead of real content
Solution: Draft the narrative first, then turn each slide into specific titles and bulletsProblem: The deck uses too many slides for the requested audience
Solution: Compress the outline to the most important 4 to 8 slides unless the user explicitly wants a longer deckProblem: The script forgets to save or print a completion message
Solution: Always end withprs.save(...)and a short success print
Related Skills
@pptx-official- Use when the task is about inspecting or editing existing PowerPoint files@docx-official- Use when the requested output should be a document instead of a slide deck
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
常见问题
生成的脚本开箱即用吗?
可以。脚本是完整的,安装 `python-pptx` 库之后就可以直接运行。
如果我没有指定页数会怎样?
AI 会使用一个合理的默认页数,通常在 4 到 8 页之间,并会在生成的脚本注释里说明。
我能让 AI 做一种特定的视觉风格吗?
AI 使用的是 `python-pptx` 库中的标准版式。它不会制作复杂的自定义视觉风格,但会确保内容组织得井井有条。
详情
作者的原始描述
Generate complete Python scripts that build polished PowerPoint decks with python-pptx and real slide content.
热度
- GitHub 星标
- 48k
- 排名
- #5551
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。