pptx
Work with Microsoft PowerPoint `.pptx` files using the installed `paper-pptx` distribution, which imports as `pptx` and extends `python-pptx` with inspection, guarded edits, composition, diffs, and package-preserving saves.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 237
- Forks
- 24
01 前言 Front Matter
- name
- pptx
- description
- Work with Microsoft PowerPoint `.pptx` files using the installed `paper-pptx` distribution, which imports as `pptx` and extends `python-pptx` with inspection, guarded edits, composition, diffs, and package-preserving saves.
02 资源文件 103
- 参考文档references/api/action.md2.5 KB
- 参考文档references/api/api.md516 B
- 参考文档references/api/chart.axis.md4.4 KB
- 参考文档references/api/chart.category.md2.5 KB
- 参考文档references/api/chart.chart.md5.4 KB
- 参考文档references/api/chart.data.md11.7 KB
- 参考文档references/api/chart.datalabel.md3.5 KB
- 参考文档references/api/chart.legend.md1.3 KB
- 参考文档references/api/chart.marker.md1008 B
- 参考文档references/api/chart.plot.md1.9 KB
- 参考文档references/api/chart.point.md1.3 KB
- 参考文档references/api/chart.series.md2.4 KB
- 参考文档references/api/chart.xlsx.md2.0 KB
- 参考文档references/api/chart.xmlwriter.md552 B
- 参考文档references/api/compose.md4.9 KB
- 参考文档references/api/diff.md9.3 KB
- 参考文档references/api/dml.chtfmt.md822 B
- 参考文档references/api/dml.color.md1.8 KB
- 参考文档references/api/dml.effect.md988 B
- 参考文档references/api/dml.fill.md3.4 KB
- 参考文档references/api/dml.line.md1.5 KB
- 参考文档references/api/edit.md3.5 KB
- 参考文档references/api/enum.action.md2.0 KB
- 参考文档references/api/enum.base.md1.9 KB
- 参考文档references/api/enum.chart.md15.9 KB
- 参考文档references/api/enum.dml.md13.5 KB
- 参考文档references/api/enum.lang.md26.1 KB
- 参考文档references/api/enum.shapes.md32.6 KB
- 参考文档references/api/enum.text.md9.4 KB
- 参考文档references/api/errors.md2.9 KB
- 参考文档references/api/exc.md472 B
- 参考文档references/api/hf.md1.3 KB
- 参考文档references/api/index.md83.7 KB
- 参考文档references/api/inspect.md15.0 KB
- 参考文档references/api/media.md8.3 KB
- 参考文档references/api/opc.constants.md22.4 KB
- 参考文档references/api/opc.oxml.md3.8 KB
- 参考文档references/api/opc.package.md6.4 KB
- 参考文档references/api/opc.packuri.md2.2 KB
- 参考文档references/api/opc.serialized.md2.9 KB
- 参考文档references/api/opc.shared.md445 B
- 参考文档references/api/opc.spec.md1006 B
- 参考文档references/api/oxml.action.md1004 B
- 参考文档references/api/oxml.chart.axis.md7.0 KB
- 参考文档references/api/oxml.chart.chart.md4.0 KB
- 参考文档references/api/oxml.chart.datalabel.md3.3 KB
- 参考文档references/api/oxml.chart.legend.md1.2 KB
- 参考文档references/api/oxml.chart.marker.md1.4 KB
- 参考文档references/api/oxml.chart.plot.md6.3 KB
- 参考文档references/api/oxml.chart.series.md5.1 KB
- 参考文档references/api/oxml.chart.shared.md3.5 KB
- 参考文档references/api/oxml.coreprops.md2.9 KB
- 参考文档references/api/oxml.dml.color.md1.4 KB
- 参考文档references/api/oxml.dml.fill.md3.2 KB
- 参考文档references/api/oxml.dml.line.md373 B
- 参考文档references/api/oxml.md990 B
- 参考文档references/api/oxml.ns.md2.0 KB
- 参考文档references/api/oxml.presentation.md3.7 KB
- 参考文档references/api/oxml.shapes.autoshape.md6.4 KB
- 参考文档references/api/oxml.shapes.connector.md1.7 KB
- 参考文档references/api/oxml.shapes.graphfrm.md6.2 KB
- 参考文档references/api/oxml.shapes.groupshape.md4.2 KB
- 参考文档references/api/oxml.shapes.md317 B
- 参考文档references/api/oxml.shapes.picture.md2.2 KB
- 参考文档references/api/oxml.shapes.shared.md7.2 KB
- 参考文档references/api/oxml.simpletypes.md13.4 KB
- 参考文档references/api/oxml.slide.md6.7 KB
- 参考文档references/api/oxml.table.md9.1 KB
- 参考文档references/api/oxml.text.md14.0 KB
- 参考文档references/api/oxml.theme.md435 B
- 参考文档references/api/oxml.xmlchemy.md5.3 KB
- 参考文档references/api/package.md7.3 KB
- 参考文档references/api/parts.chart.md1.5 KB
- 参考文档references/api/parts.coreprops.md1.2 KB
- 参考文档references/api/parts.embeddedpackage.md2.0 KB
- 参考文档references/api/parts.image.md3.4 KB
- 参考文档references/api/parts.media.md621 B
- 参考文档references/api/parts.presentation.md2.6 KB
- 参考文档references/api/parts.slide.md5.0 KB
- 参考文档references/api/presentation.md10.0 KB
- 参考文档references/api/rebind.md3.5 KB
- 参考文档references/api/shapes.autoshape.md6.4 KB
- 参考文档references/api/shapes.base.md3.7 KB
- 参考文档references/api/shapes.connector.md3.1 KB
- 参考文档references/api/shapes.freeform.md3.1 KB
- 参考文档references/api/shapes.graphfrm.md2.2 KB
- 参考文档references/api/shapes.group.md1.4 KB
- 参考文档references/api/shapes.md529 B
- 参考文档references/api/shapes.picture.md3.5 KB
- 参考文档references/api/shapes.placeholder.md4.1 KB
- 参考文档references/api/shapes.shapetree.md8.0 KB
- 参考文档references/api/shared.md1.5 KB
- 参考文档references/api/slide.md13.8 KB
- 参考文档references/api/slideops.md1.6 KB
- 参考文档references/api/spec.md18.9 KB
- 参考文档references/api/table.md6.2 KB
- 参考文档references/api/text.bullet.md3.0 KB
- 参考文档references/api/text.fonts.md501 B
- 参考文档references/api/text.layout.md708 B
- 参考文档references/api/text.text.md9.0 KB
- 参考文档references/api/types.md696 B
- 参考文档references/api/util.md3.7 KB
- 参考文档references/paper-api.md12.6 KB
03 SKILL.md 正文
PPTX with paper-pptx
paper-pptx is an upgraded distribution of python-pptx. It keeps the familiar import and ordinary API:
from pptx import Presentation
presentation = Presentation(source_path)
Use your existing knowledge of python-pptx for normal slides, shapes, text, tables, charts, images, layouts, and formatting. The fork adds public APIs for the places where ordinary python-pptx is thin: effective-value inspection, stable targeting, notes and footer handling, slide lifecycle, relationship-aware clone/import/composition, owned chart and media graphs, semantic diffs, and package-preserving saves.
paper-pptx is installed under the pptx import.
The Paper API companion maps Paper-specific capabilities to their public symbols. The generated API reference covers the complete public API, including the surface inherited from python-pptx, with one page per module. It is large; search by symbol and read only the relevant section.
Package behavior
Paper operations refuse ambiguous targets rather than selecting the first matching layout, placeholder, section, shape, or text block. A presentation.batch() block validates once at exit and discards every edit in the block if validation fails.
A PaperRefusal means paper-pptx cannot guarantee the attempted operation through its guarded API. The concrete subclass and message identify the condition that caused the refusal. In rare cases an ordinary python-pptx mutation or direct package editing may be appropriate when unguarded serialization is intentionally acceptable and its effects on the deck's relationship and ownership graph are understood. Verify the resulting deck carefully.
Opening a deck can also refuse. paper-pptx validates every member of the package on intake and rejects an archive with more than one reading or one that is unsafe to expand, so a hand-rezipped or tool-mangled file may raise PackageLimitError where upstream python-pptx opened it. Report the refusal and its message rather than working around it; each such refusal matches what PowerPoint itself does with that file.
Precise ZIP/OOXML work is still available when it is genuinely narrower than object-model mutation, the exact members and relationships are understood, and the candidate can be checked independently. Never copy a slide, chart, image, notes part, or shape XML without accounting for its complete relationship and ownership graph.
Saving
presentation.save(output) uses normalized serialization and can rewrite semantically unchanged package members. patch_save(source, presentation, output) preserves unrelated original XML bytes and returns a diff.
Saving is refused while a batch() block is open, so close the block before writing.
04 同仓库更多 Skills
xlsx
Work with Excel `.xlsx` and `.xlsm` files using the installed `paper-xlsx` distribution, which imports as `openpyxl` and extends it with preservation-aware saves, guarded structural edits, recalculation helpers, diffs, and richer inspection.
Work with PDF files using the installed tools for fixed-page authoring, extraction, page operations, forms, annotations, redactions, and mechanical checks.
docx
Work with Microsoft Word `.docx` files using the installed `paper-docx` distribution, which imports as `docx` and extends `python-docx` with inspection, guarded edits, review structures, composition, diffs, and byte-preserving saves.
generate-greeting
Generate a greeting message and write it to a file.