Python PowerPoint libraries

Updated Nov 2026

Python PowerPoint libraries create, read, and edit PowerPoint presentations from code. A file library edits the PPTX format directly rather than driving an installed copy of PowerPoint through COM automation. These libraries let report generators and AI agents turn data and drafts into slide decks.

Popularity

python-pptx has the most monthly downloads in this comparison, at 142.1M.

LibraryMonthly downloadsStarsLast releaseLicense
python-pptx
142.1M
3.6KAug 2024MIT
pywin32
19.5M
5.6KJun 2026PSF
PyPandoc
4.5M
1.2KMar 2026MIT
comtypes
2.4M
351Nov 2026MIT
Pandoc Python Library
871.4K
188Aug 2024MIT
Aspose.Slides
176.8K
12Nov 2026Proprietary
Spire.Presentation
37.3K
10Aug 2026Proprietary
python-pptx-text-replacer
13.7K
15Sep 2022GPLv3
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Creates, reads, and updates PowerPoint presentation files.

Downloads / mo
142.1M
Stars
3.6K
Last release
1.0.2
License
MIT

Strengths

  • Builds slides from existing layouts. Add slides using a presentation’s existing slide layouts.
  • Supports in-memory presentation files. Open or save a presentation through a file-like object.

Limitations

  • Expects newer PowerPoint files. Convert legacy PPT files to PPTX before opening them.
  • Needs another tool for rendering. Use a separate renderer for PDF or slide-image output.

Quickstart

From quickstart.rst
$ pip install python-pptx
from pptx import Presentation

prs = Presentation()
title_slide_layout = prs.slide_layouts[0]
slide = prs.slides.add_slide(title_slide_layout)
title = slide.shapes.title
subtitle = slide.placeholders[1]

title.text = "Hello, World!"
subtitle.text = "python-pptx was here!"

prs.save('test.pptx')

python-pptx examples

From open-source projects on GitHub

Provides Python extensions for Windows.

Downloads / mo
19.5M
Stars
5.6K
Last release
312
License
PSF

Quickstart

From __init__.py
$ pip install pywin32
from win32com.client import Dispatch

powerpoint = Dispatch("PowerPoint.Application")
presentation = powerpoint.Presentations.Add()

Wraps Pandoc in a thin Python layer.

Downloads / mo
4.5M
Stars
1.2K
Last release
1.17
License
MIT

Quickstart

From __init__.py
$ pip install pypandoc
import pypandoc

pypandoc.convert_text("# Example\n\nContent", "pptx", format="md", outputfile="example.pptx")

PyPandoc examples

From open-source projects on GitHub

Implements COM in pure Python.

Downloads / mo
2.4M
Stars
351
Last release
1.5.0
License
MIT

Quickstart

From _create.py
$ pip install comtypes
from comtypes.client import CreateObject

powerpoint = CreateObject("PowerPoint.Application")
presentation = powerpoint.Presentations.Add()

Pandoc Python Library

Represents Pandoc documents in Python.

Downloads / mo
871.4K
Stars
188
Last release
2.4
License
MIT

Quickstart

From __init__.py
$ pip install pandoc
import pandoc

document = pandoc.read("# Example\n\nContent", format="markdown")
pandoc.write(document, file="example.pptx", format="pptx")

Reads, edits, and renders PowerPoint and OpenDocument presentations through the commercial SDK.

Downloads / mo
176.8K
Stars
12
Last release
26.11.0
License
Proprietary

Strengths

  • Reads legacy presentation formats. Open PPT files alongside newer PowerPoint and OpenDocument presentations.
  • Renders presentation previews. Export presentations to PDF or supported image formats.

Limitations

  • Unlicensed output contains watermarks. Evaluation mode adds a watermark to every saved presentation slide.
  • Evaluation truncates extracted text. Text read in evaluation mode is shortened and marked with a notice.

Quickstart

From README.md
$ pip install aspose-slides
import aspose.slides as slides

# Instantiates a Presentation object that represents a presentation file
with slides.Presentation() as presentation:
    slide = presentation.slides[0]
    # Adds an autoshape with type set to line
    slide.shapes.add_auto_shape(slides.ShapeType.LINE, 50, 150, 300, 0)
    presentation.save("NewPresentation_out.pptx", slides.export.SaveFormat.PPTX)

Aspose.Slides examples

From open-source projects on GitHub

Spire.Presentation

Creates, edits, and converts PowerPoint presentations through the professional Python SDK.

Downloads / mo
37.3K
Stars
10
Last release
11.8.1
License
Proprietary

Strengths

  • Reads older PowerPoint formats. Open legacy PPT presentations alongside newer PPTX files.
  • Exports slide previews. Render slides to images or export a presentation as PDF.

Limitations

  • Evaluation output shows a message. Use a temporary license to evaluate conversion without the message.

Quickstart

From README.md
$ pip install Spire.Presentation
from spire.presentation import *

outputFile ="HelloWorld.pptx"
presentation = Presentation()
presentation.SaveToFile(outputFile, FileFormat.Pptx2010)
presentation.Dispose()

Spire.Presentation examples

From open-source projects on GitHub

python-pptx-text-replacer

Replaces text in PowerPoint files in PPTX format.

Downloads / mo
13.7K
Stars
15
Last release
0.0.6
License
GPLv3

Quickstart

From README.md
$ pip install python-pptx-text-replacer
from python_pptx_text_replacer import TextReplacer
replacer = TextReplacer("original.pptx", slides='',
 tables=True, charts=True, textframes=True)
replacer.replace_text( [ ('FY2021','FY2122') ] )
replacer.write_presentation_to_file("./changed.pptx")

FAQ

python-pptx suits creating and editing PPTX files on any platform. Aspose.Slides and Spire.Presentation suit teams that need a commercial SDK that also renders slides as images. pywin32 suits Windows machines that automate an installed copy of PowerPoint.

python-pptx creates, reads, and updates PowerPoint files through slide and shape objects. It does not render slides as images.

python-pptx builds a presentation from slide layouts and adds text boxes, pictures, and shapes to each slide before saving the file.

python-pptx cannot render slides. Aspose.Slides and Spire.Presentation export slide images through their own renderers. On Windows, pywin32 can call the export function of an installed copy of PowerPoint.

For coding agents

Found your PowerPoint library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official