Skip to main content

A Python tool for automated editing of PowerPoint templates using python-pptx

Project description

AutoPPTX

alt text

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:

AutoPPTX Demo


Requirements

  • Python >= 3.10
  • python-pptx >= 1.0.2
  • lxml >= 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

autopptx-0.1.3.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autopptx-0.1.3-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file autopptx-0.1.3.tar.gz.

File metadata

  • Download URL: autopptx-0.1.3.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

Hashes for autopptx-0.1.3.tar.gz
Algorithm Hash digest
SHA256 335598e77b3929131c9de7c8608cec350fa97fae2f6a072d6c4e06ca09e27958
MD5 828332f57401bf0d539a27656d0d9cee
BLAKE2b-256 1754aea8130202a48d41ad68ff0f5f6f02aba00f5cd4e6b2f70dcbb620ae4979

See more details on using hashes here.

File details

Details for the file autopptx-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: autopptx-0.1.3-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

Hashes for autopptx-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2634c5507476949f56631b1b664d0d4cd61a77b29203626b08665532f0e19d74
MD5 7ca07d3c82230f87653394c0f4a45eab
BLAKE2b-256 40a55406685ff078f42cd676f8ce225344822ec9a3f050f7ca134e6ddd9c2dee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page