A Python tool for automated editing of PowerPoint templates using python-pptx
Project description
AutoPPTX
AutoPPTX is a Python toolkit for automated editing of PowerPoint templates using the python-pptx library.
It is designed for data scientists, researchers, and business analysts who want to automate slide generation from structured data such as JSON files.
AutoPPTX supports intelligent replacement and styling of text, image, and table placeholders in PowerPoint templates.
Features
-
✅ Multi-type placeholder replacement
Replace titles, subtitles, body text, images, and tables with structured data. -
🎨 Styling Support
Supports style extraction, style application, and style transfer across text boxes, tables, and images — including font, alignment, background color, position, size... -
🔍 Placeholder type recognition and content inspection
Identify and inspect placeholder types (text, image, table) and their content. -
🧩 Modular architecture
Well-structured codebase with separate modules for Text, Image, Table, Type, and View. -
🧪 Tested and standardized
Includes unit tests and conforms to PEP8 and black code formatting.
📽️ Demo Preview
The following animation demonstrates how AutoPPTX replaces placeholders and styles text, images, and tables based on JSON input:
Requirements
- Python >= 3.10
python-pptx>= 1.0.2lxml>= 5.3.1
Installation
# For regular usage
pip install autopptx
# For development (includes test dependencies)
pip install -e ".[dev]"
Usage
CLI Example
python -m autopptx.core.runner \
--template ./data/template.pptx \
--input ./data/input_data.json \
--output ./data/output_demo.pptx
Python API Example
from autopptx.core.runner import main
main(
template_path="./data/template.pptx",
input_json="./data/input_data.json",
output_path="./data/output_demo.pptx",
)
Example Input (input_data.json)
[
{
"title": "What They Eat",
"subtitle": "Table 1",
"bodytext": "Cats need protein-rich diets, primarily consisting of meat.",
"table": [
[
["Animal", "Favorite Food"],
["Cat", "Fish, Meat"],
["Bunny", "Carrots, Hay"]
]
]
}
]
Project Structure
AutoPPTX/
├── autopptx/ # 📦 Main Python package
│ ├── Text/ # Text replacement & style
│ ├── Image/ # Image replacement & layout
│ ├── Table/ # Table replacement & formatting
│ ├── Type/ # Placeholder type detection
│ ├── View/ # Slide viewer tools
│ └── core/ # CLI runner entry point
├── data/ # Example JSON and PPTX templates
├── assets/ # README media (GIFs, images)
├── tests/ # Unit tests
├── env.sh # Environment setup script
├── pyproject.toml # Build & packaging configuration
├── MANIFEST.in # Packaging resource includes
├── requirements.txt # Python dependencies list
├── .gitignore # Git ignore rules
├── LICENSE # MIT License
└── README.md # Project documentation
Development
Clone the repo and set up:
git clone https://github.com/chenzhex/AutoPPTX.git
cd AutoPPTX
pip install -e ".[dev]"
Code Formatting
black autopptx tests
Running Tests
pytest tests/ --cov=autopptx
Contributing
Contributions, issues, and feature requests are welcome!
Please open a GitHub Issue or submit a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Citation
If you use AutoPPTX in your research, please cite the following JOSS paper:
@article{chen2025autopptx,
title = {AutoPPTX: Automated PowerPoint Generation with Python},
author = {Chen, Zhe},
journal = {Journal of Open Source Software},
year = {2025},
note = {Submitted}
}
AutoPPTX simplifies and streamlines automated slide generation for reproducible research and business reporting.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autopptx-0.1.2.tar.gz.
File metadata
- Download URL: autopptx-0.1.2.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
783ba9829c0f0423a26067d50273a72e953d9f69a4f3b0376aa160662259090f
|
|
| MD5 |
c187886ba09689c6f5ba38d5e43e51b5
|
|
| BLAKE2b-256 |
d4da5079a26e3df493c0bc1046edb5b48efc215faa482e393fc1cfb1bcfba9cc
|
File details
Details for the file autopptx-0.1.2-py3-none-any.whl.
File metadata
- Download URL: autopptx-0.1.2-py3-none-any.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35cb7aada4d41d37032d7eb55def9a78cfa396f49fd956d42e3fca2af8ae01d4
|
|
| MD5 |
219a179e71d367b45e3e876edecf6a15
|
|
| BLAKE2b-256 |
e2279953f5090a221165122a65a97ce492c0e6e55f11194743cbccc5d4bc886f
|