python-pptx¶
Release v0.6.21 (Installation)
python-pptx is a Python library for creating and updating PowerPoint (.pptx) files.
A typical use would be generating a customized PowerPoint presentation from database content, downloadable by clicking a link in a web application. Several developers have used it to automate production of presentation-ready engineering status reports based on information held in their work management system. It could also be used for making bulk updates to a library of presentations or simply to automate the production of a slide or two that would be tedious to get right by hand.
More information is available in the python-pptx documentation.
Browse examples with screenshots to get a quick idea what you can do with python-pptx.
Feature Support¶
python-pptx has the following capabilities, with many more on the roadmap:
- Round-trip any Open XML presentation (.pptx file) including all its elements
- Add slides
- Populate text placeholders, for example to create a bullet slide
- Add image to slide at arbitrary position and size
- Add textbox to a slide; manipulate text font size and bold
- Add table to a slide
- Add auto shapes (e.g. polygons, flowchart shapes, etc.) to a slide
- Add and manipulate column, bar, line, and pie charts
- Access and change core document properties such as title and subject
Additional capabilities are actively being developed and added on a release cadence of roughly once per month. If you find a feature you need that python-pptx doesn’t yet have, reach out via the mailing list or issue tracker and we’ll see if we can jump the queue for you to pop it in there :)
User Guide¶
Community Guide¶
API Documentation¶
- Presentations
- Slides
- Shapes
- Placeholders
- Table-related objects
- ChartData objects
- Charts
- Text-related objects
- Click Action-related Objects
- DrawingML objects
- Image
- Exceptions
util
Module- Enumerations
MSO_AUTO_SHAPE_TYPE
MSO_AUTO_SIZE
MSO_COLOR_TYPE
MSO_CONNECTOR_TYPE
MSO_FILL_TYPE
MSO_LANGUAGE_ID
MSO_LINE_DASH_STYLE
MSO_PATTERN_TYPE
MSO_SHAPE_TYPE
MSO_TEXT_UNDERLINE_TYPE
MSO_THEME_COLOR_INDEX
MSO_VERTICAL_ANCHOR
PP_ACTION_TYPE
PP_MEDIA_TYPE
PP_PARAGRAPH_ALIGNMENT
PP_PLACEHOLDER_TYPE
XL_AXIS_CROSSES
XL_CATEGORY_TYPE
XL_CHART_TYPE
XL_DATA_LABEL_POSITION
XL_LEGEND_POSITION
XL_MARKER_STYLE
XL_TICK_LABEL_POSITION
XL_TICK_MARK
- Excel Number Formats