1. Products
  2.   Presentation
  3.   Python
  4.   Python-PPTX

Python API to Generate PowerPoint PPTX Presentation

Open Source Python library to Create, Modify & Export Microsoft PowerPoint PPTX files.

Python-PPTX is an Open Source Python library that enables software programmers to easily generate and manipulate Open XML PowerPoint (PPTX) files inside their own Python apps without any external dependencies. It helps developers to automate the production of PPTX presentations by customizing PowerPoint presentation creation from database content or making bulk updates to a library of presentations or automating the production of slides.

The library provides support for several important features such as generating & edit a presentation, inserting new slides, Adding text-box to a slide, manipulating text font size, table addition to the slide, auto shapes support, adding & manipulate column, bar, line, or pie charts and many other features.

Previous Next

Getting Started with Python-PPTX

Python-PPTX is hosted on PyPI, so installing with pip is simple. Please use the following command.

pip command

 pip install python-pptx 

lxml package and Pillow both are required for Python-PPTX to run smoothly. The charting features depend on XlsxWriter. Both pip and easy_install will take care of satisfying these dependencies for you. If you want to install it using setup.py then you will require installing the dependencies yourself.

Generate & Modify PowerPoint PPTX Presentation using Python API

Python-PPTX API provides functionality for new PowerPoint PPTX presentation creation as well as modification inside Python applications. Software developers can easily modify an existing presentation by opening the existing presentation. It allows adding slides, specifying a layout for new slides, adding titles and contents, inserting images and shapes, etc. Once done you can change the name of the existing presentation as well as can save it to the location of your choice.

Working with PPTX Slide and Images

Python-PPTX is a great library for using Python to create dynamic PowerPoint slides. Software programmers can add a slide to an existing presentation with ease. Every slide in a presentation is based on a slide layout.  Slide layout is like a template for a slide, it allows users to inherit formatting choices, text boxes, titles or graphics, etc.

Adding & Modifying Charts to A Presentation

Python-PPTX API allows software developers to add charts to a slide and also modify existing ones inside their own applications. The API supports the most common chart types other than 3D types. You can add a single-series column chart, multi-series chart, bubble chart, Line chart, pie charts & more. By default, the colors assigned to each series in a chart are the theme colors Accent 1 through Accent 6, in that order. You can also assign specific colors to data points in pie, bar, and line segments for at least some chart types. The easiest and suggested way will be to change the theme colors in your starting "template" presentation.