Package: python-pptx-ng
python-pptx-ngis a Python library for creating, reading, and updating PowerPoint (.pptx)
files.This library is a continuation of the work done by Steve Canny (scanny) on thepython-pptxproject. The original project is no longer maintained and has been
forked to continue development.A typical use would be generating a PowerPoint presentation from dynamic content such as
a database query, analytics output, or a JSON payload, perhaps in response to an HTTP
request and downloading the generated PPTX file in response. It runs on any Python
capable platform, including macOS and Linux, and does not require the PowerPoint
application to be installed or licensed.It can also be used to analyze PowerPoint files from a corpus, perhaps to extract search
indexing text and images.In can also be used to simply automate the production of a slide or two that would be
tedious to get right by hand, which is how this all got started.More information is available in thepython-pptx-ng documentation.Browseexamples with screenshotsto get a quick idea what you can do with
python-pptx-ng.Release History0.6.23 (2023-11-02)fix: #912 Pillow<=9.5 constraint entails security vulnerability0.6.22 (2023-08-28)Add #909 Add imgW, imgH params toshapes.add_ole_object()fix: #754 _Relationships.items() raisesfix: #758 quote in autoshape name must be escapedfix: #746 update Python 3.x support in docsfix: #748 setup’slicenseshould be short stringfix: #762 AttributeError: module ‘collections’ has no attribute ‘abc’(Windows Python 3.10+)0.6.21 (2021-09-20)Fix #741 _DirPkgReader must implement .__contains__()0.6.20 (2021-09-14)Fix #206 accommodate NULL target-references in relationships.Fix #223 escape image filename that appears as literal in XML.Fix #517 option to display chart categories/values in reverse order.Major refactoring of ancient package loading code.0.6.19 (2021-05-17)Add shapes.add_ole_object(), allowing arbitrary Excel or other binary file to be
embedded as a shape on a slide. The OLE object is represented as an icon.0.6.18 (2019-05-02).text property getters encode line-break as a vertical-tab (VT, ‘v’, ASCII 11/x0B).
This is consistent with PowerPoint’s copy/paste behavior and allows like-breaks (soft
carriage-return) to be distinguished from paragraph boundary. Previously, a line-break
was encoded as a newline (’n’) and was not distinguishable from a paragraph boundary..text properties include Shape.text, _Cell.text, TextFrame.text, _Paragraph.text and
_Run.text..text property setters accept vertical-tab character and place a line-break element in
that location. All other control characters other than horizontal-tab (’t’) and
newline (’n’) in range x00-x1F are accepted and escaped with plain-text like
“_x001B” for ESC (ASCII 27).Previously a control character other than tab or newline in an assigned string would
trigger an exception related to invalid XML character.0.6.17 (2018-12-16)Add SlideLayouts.remove() - Delete unused slide-layoutAdd SlideLayout.used_by_slides - Get slides based on this slide-layoutAdd SlideLayouts.index() - Get index of slide-layout in masterAdd SlideLayouts.get_by_name() - Get slide-layout by its str name0.6.16 (2018-11-09)Feature #395 DataLabels.show_* properties, e.g. .show_percentageFeature #453 Chart data tolerates None for labels0.6.15 (2018-09-24)Fix #436 ValueAxis._cross_xAx fails on c:dateAxis0.6.14 (2018-09-24)Add _Cell.merge()Add _Cell.split()Add _Cell.__eq__()Add _Cell.is_merge_originAdd _Cell.is_spannedAdd _Cell.span_heightAdd _Cell.span_widthAdd _Cell.text getterAdd Table.iter_cells()Move pptx.shapes.table module to pptx.tableAdd user documentation ‘Working with tables’0.6.13 (2018-09-10)Add Chart.fontFix #293 Can’t hide title of single-series ChartFix shape.width value is not type EmuFix add a:defRPr with c:rich (fixes some font inheritance breakage)0.6.12 (2018-08-11)Add Picture.auto_shape_typeRemove Python 2.6 testing from buildUpdate dependencies to avoid vulnerable Pillow versionFix #260, #301, #382, #401Add _Paragraph.add_line_break()Add Connector.line0.6.11 (2018-07-25)Add gradient fill.Add experimental “turbo-add” option for producing large shape-count slides.0.6.10 (2018-06-11)Addshape.shadowproperty to autoshape, connector, picture, and group
shape, returning aShadowFormatobject.AddShadowFormatobject with read/write (boolean).inheritproperty.Fix #328 add support for 26+ series in a chart0.6.9 (2018-05-08)AddPicture.crop_xsetters, allowing picture cropping values to be set,
in addition to interrogated.AddSlide.backgroundandSlideMaster.background, allowing the
background fill to be set for an individual slide or for all slides based
on a slide master.Add optionshapesparameter toShapes.add_group_shape, allowing a group
shape to be formed from a number of existing shapes.Improve efficiency ofShapes._next_shape_idproperty to improve
performance on high shape-count slides.0.6.8 (2018-04-18)AddGroupShape, providing properties specific to a group shape, including
itsshapesproperty.AddGroupShapes, providing access to shapes contained in a group shape.AddSlideShapes.add_group_shape(), allowing a group shape to be added to
a slide.AddGroupShapes.add_group_shape(), allowing a group shape to be added to
a group shape, enabling recursive, multi-level groups.Add support for adding jump-to-named-slide behavior to shape and run
hyperlinks.0.6.7 (2017-10-30)AddSlideShapes.build_freeform(), allowing freeform shapes (such as maps)
to be specified and added to a slide.Add support for patterned fills.AddLineFormat.dash_styleto allow interrogation and setting of dashed
line styles.0.6.6 (2017-06-17)AddSlideShapes.add_movie(), allowing video media to be added to a slide.fix #190 Accommodate non-conforming part names having ‘00’ index segment.fix #273 Accommodate non-conforming part names having no index segment.fix #277 ASCII/Unicode error on non-ASCII multi-level category namesfix #279 BaseShape.id warning appearing on placeholder access.0.6.5 (2017-03-21)#267 compensate for non-conforming PowerPoint behavior on c:overlay elementcompensate for non-conforming (to spec) PowerPoint behavior related to
c:dLbl/c:tx that results in “can’t save” error when explicit data labels
are added to bubbles on a bubble chart.0.6.4 (2017-03-17)add Chart.chart_title and ChartTitle object#263 Use Number type to test for numeric category0.6.3 (2017-02-28)add DataLabel.fontadd Axis.axis_title0.6.2 (2017-01-03)add support for NotesSlide (slide notes, aka. notes page)add support for arbitrary series ordering in XMLadd Plot.categories providing access to hierarchical categories in an
existing chart.add support for date axes on category charts, including writing a dateAx
element for the category axis when ChartData categories are date or
datetime.BACKWARD INCOMPATIBILITIES:Some changes were made to the boilerplate XML used to create new charts. This
was done to more closely adhere to the settings PowerPoint uses when creating
a chart using the UI. This may result in some appearance changes in charts
after upgrading. In particular:Chart.has_legend now defaults to True for Line charts.Plot.vary_by_categories now defaults to False for Line charts.0.6.1 (2016-10-09)add Connector shape type0.6.0 (2016-08-18)add XY chart typesadd Bubble chart typesadd Radar chart typesadd Area chart typesadd Doughnut chart typesadd Series.points and Pointadd Point.data_labeladd DataLabel.text_frameadd DataLabel.positionadd Axis.major_gridlinesadd ChartFormat with .fill and .lineadd Axis.format (fill and line formatting)add ValueAxis.crosses and .crosses_atadd Point.format (fill and line formatting)add Slide.slide_idadd Slides.get() (by slide id)add Font.language_idsupport blank (None) data points in created chartsadd Series.markeradd Point.markeradd Marker.format, .style, and .size0.5.8 (2015-11-27)add Shape.click_action (hyperlink on shape)fix: #128 Chart cat and ser names not escapedfix: #153 shapes.title raises on no title shapefix: #170 remove seek(0) from Image.from_file()0.5.7 (2015-01-17)add PicturePlaceholder with .insert_picture() methodadd TablePlaceholder with .insert_table() methodadd ChartPlaceholder with .insert_chart() methodadd Picture.image property, returning Image objectadd Picture.crop_left, .crop_top, .crop_right, and .crop_bottomadd Shape.placeholder_format and PlaceholderFormat objectBACKWARD INCOMPATIBILITIES:Shape.shape_type is now unconditionallyMSO_SHAPE_TYPE.PLACEHOLDERfor all
placeholder shapes. Previously, some placeholder shapes reportedMSO_SHAPE_TYPE.AUTO_SHAPE,MSO_SHAPE_TYPE.CHART,MSO_SHAPE_TYPE.PICTURE, orMSO_SHAPE_TYPE.TABLEfor that property.0.5.6 (2014-12-06)fix #138 - UnicodeDecodeError in setup.py on Windows 7 Python 3.40.5.5 (2014-11-17)feature #51 - add Python 3 support0.5.4 (2014-11-15)feature #43 - image native size in shapes.add_picture() is now calculated
based on DPI attribute in image file, if present, defaulting to 72 dpi.feature #113 - Add Paragraph.space_before, Paragraph.space_after, and
Paragraph.line_spacing0.5.3 (2014-11-09)add experimental feature TextFrame.fit_text()0.5.2 (2014-10-26)fix #127 - Shape.text_frame fails on shape having no txBody0.5.1 (2014-09-22)feature #120 - add Shape.rotationfeature #97 - add Font.underlineissue #117 - add BMP image supportissue #95 - add BaseShape.name setterissue #107 - all .text properties should return unicode, not strfeature #106 - add .text getters to Shape, TextFrame, and ParagraphRename Shape.textframe to Shape.text_frame.Shape.textframe property (by that name) is deprecated.0.5.0 (2014-09-13)Add support for creating and manipulating bar, column, line, and pie chartsMajor refactoring of XML layer (oxml)Rationalized graphical object shape accessNote backward incompatibilities belowBACKWARD INCOMPATIBILITIES:A table is no longer treated as a shape. Rather it is a graphical object
contained in a GraphicFrame shape, as are Chart and SmartArt objects.Example:table = shapes.add_table(...)

# becomes

graphic_frame = shapes.add_table(...)
table = graphic_frame.table

# or

table = shapes.add_table(...).tableAs the enclosing shape, the id, name, shape type, position, and size are
attributes of the enclosing GraphicFrame object.The contents of a GraphicFrame shape can be identified using three available
properties on a shape: has_table, has_chart, and has_smart_art. The enclosed
graphical object is obtained using the properties GraphicFrame.table and
GraphicFrame.chart. SmartArt is not yet supported. Accessing one of these
properties on a GraphicFrame not containing the corresponding object raises
an exception.0.4.2 (2014-04-29)fix: issue #88 – raises on supported image file having uppercase extensionfix: issue #89 – raises on add_slide() where non-contiguous existing ids0.4.1 (2014-04-29)Rename Presentation.slidemasters to Presentation.slide_masters.
Presentation.slidemasters property is deprecated.Rename Presentation.slidelayouts to Presentation.slide_layouts.
Presentation.slidelayouts property is deprecated.Rename SlideMaster.slidelayouts to SlideMaster.slide_layouts.
SlideMaster.slidelayouts property is deprecated.Rename SlideLayout.slidemaster to SlideLayout.slide_master.
SlideLayout.slidemaster property is deprecated.Rename Slide.slidelayout to Slide.slide_layout. Slide.slidelayout property
is deprecated.Add SlideMaster.shapes to access shapes on slide master.Add SlideMaster.placeholders to access placeholder shapes on slide master.Add _MasterPlaceholder class.Add _LayoutPlaceholder class with position and size inheritable from master
placeholder.Add _SlidePlaceholder class with position and size inheritable from layout
placeholder.Add Table.left, top, width, and height read/write properties.Add rudimentary GroupShape with left, top, width, and height properties.Add rudimentary Connector with left, top, width, and height properties.Add TextFrame.auto_size property.Add Presentation.slide_width and .slide_height read/write properties.Add LineFormat class providing access to read and change line color and
width.Add AutoShape.lineAdd Picture.lineRationalize enumerations.Note backward incompatibilities belowBACKWARD INCOMPATIBILITIES:The following enumerations were moved/renamed during the rationalization of
enumerations:pptx.enum.MSO_COLOR_TYPE–>pptx.enum.dml.MSO_COLOR_TYPEpptx.enum.MSO_FILL–>pptx.enum.dml.MSO_FILLpptx.enum.MSO_THEME_COLOR–>pptx.enum.dml.MSO_THEME_COLORpptx.constants.MSO.ANCHOR_*–>pptx.enum.text.MSO_ANCHOR.*pptx.constants.MSO_SHAPE–>pptx.enum.shapes.MSO_SHAPEpptx.constants.PP.ALIGN_*–>pptx.enum.text.PP_ALIGN.*pptx.constants.MSO.{SHAPE_TYPES}–>pptx.enum.shapes.MSO_SHAPE_TYPE.*Documentation for all enumerations is available in the Enumerations section
of the User Guide.0.3.2 (2014-02-07)Hotfix: issue #80 generated presentations fail to load in Keynote and other
Apple applications0.3.1 (2014-01-10)Hotfix: failed to load certain presentations containing images with
uppercase extension0.3.0 (2013-12-12)Add read/write font color property supporting RGB, theme color, and inherit
color typesAdd font typeface and italic supportAdd text frame margins and word-wrapAdd support for external relationships, e.g. linked spreadsheetAdd hyperlink support for text run in shape and table cellAdd fill color and brightness for shape and table cell, fill can also be set
to transparent (no fill)Add read/write position and size properties to shape and pictureReplace PIL dependency with PillowRestructure modules to better suit size of library0.2.6 (2013-06-22)Add read/write access to core document propertiesHotfix to accomodate connector shapes in _AutoShapeTypeHotfix to allow customXml parts to load when present0.2.5 (2013-06-11)Add paragraph alignment property (left, right, centered, etc.)Add vertical alignment within table cell (top, middle, bottom)Add table cell margin propertiesAdd table boolean properties: first column (row header), first row (column
headings), last row (for e.g. totals row), last column (for e.g. row
totals), horizontal banding, and vertical banding.Add support for auto shape adjustment values, e.g. change radius of corner
rounding on rounded rectangle, position of callout arrow, etc.0.2.4 (2013-05-16)Add support for auto shapes (e.g. polygons, flowchart symbols, etc.)0.2.3 (2013-05-05)Add support for table shapesAdd indentation support to textbox shapes, enabling multi-level bullets on
bullet slides.0.2.2 (2013-03-25)Add support for opening and saving a presentation from/to a file-like
object.Refactor XML handling to use lxml objectify0.2.1 (2013-02-25)Add support for Python 2.6Add images from a stream (e.g. StringIO) in addition to a path, allowing
images retrieved from a database or network resource to be inserted without
saving first.Expand text methods to accept unicode and UTF-8 encoded 8-bit strings.Fix potential install bug triggered by importing__version__from
package__init__.pyfile.0.2.0 (2013-02-10)First non-alpha release with basic capabilities:open presentation/template or use built-in default templateadd slideset placeholder text (e.g. bullet slides)add pictureadd text box