Introduction to python-pptx
python-pptx is a Python library for creating, reading, and updating PowerPoint (.pptx) files. It enables you to generate presentations programmatically without needing PowerPoint installed, making it perfect for automation, report generation, and dynamic content creation.Installation
Get started by installing python-pptx via pip, poetry, or conda
Quickstart
Create your first presentation in minutes with our step-by-step guide
API Reference
Explore the complete API documentation and available methods
Core Concepts
Learn about presentations, slides, shapes, and placeholders
What can you do with python-pptx?
python-pptx runs on any Python-capable platform, including macOS and Linux, and does not require the PowerPoint application to be installed or licensed. It works with the modern .pptx file format (Office 2007 and later).Key features
Create presentations
Build presentations from scratch with custom layouts, themes, and content
Add rich content
Insert text boxes, images, shapes, tables, and charts programmatically
Read and analyze
Extract text and images from existing presentations for analysis
Modify existing files
Update and customize existing PowerPoint presentations
Style and format
Control fonts, colors, alignment, and formatting at a granular level
Automate workflows
Generate reports and presentations automatically from data sources
Real-world use cases
Generate dynamic reports
Create presentation-ready reports from database queries, analytics output, or API responses. Perfect for automated reporting systems where presentations need to be generated on-demand.Automate bulk updates
Make bulk updates to a library of presentations, such as updating company branding, replacing images, or standardizing formatting across multiple files.Extract and analyze content
Analyze PowerPoint files from a corpus to extract search indexing text, gather analytics, or build content inventories.Web application integration
Generate customized presentations in response to HTTP requests, allowing users to download dynamically created .pptx files from your web application.python-pptx works seamlessly with web frameworks like Flask, Django, FastAPI, and others. Simply generate the presentation in memory and return it as a downloadable response.
Why python-pptx?
Cross-platform compatibility
Works on Windows, macOS, Linux, and any platform that supports Python 3.8+
No PowerPoint required
Generate presentations without needing Microsoft Office installed or licensed
Production-ready
Mature, stable library with extensive real-world usage and active maintenance
Pythonic API
Clean, intuitive API design that feels natural to Python developers
Platform support
- Python versions: 3.8, 3.9, 3.10, 3.11, 3.12
- Operating systems: Windows, macOS, Linux, and any OS with Python support
- PowerPoint format: .pptx files (Office 2007 and later)
License
python-pptx is released under the MIT License, making it free for both personal and commercial use.Next steps
Install python-pptx
Follow our installation guide to get python-pptx set up in your environment
Complete the quickstart
Work through the quickstart tutorial to create your first presentation
Explore the API
Dive into the API reference to discover all available features