pptx-template is a PowerPoint presentation builder.
This helps your routine reporting work that have many manual copy-paste from excel chart to powerpoint, or so.
- Building a new powerpoint presentation file from a "template" pptx file which contains "id"
- Import some strings and CSV data which is defined in a JSON config file or a Python dict
- "id" in pptx template is expressed as a tiny DSL, like "{sales.0.june.us}"
- Requires Python 3.10+, pandas, python-pptx
- For now, only UTF-8 encoding is supported for json, csv
pip install pptx-template
echo '{ "slides": [ { "greeting" : "Hello!!" } ] }' > model.json
# prepare your template file (test.pptx) which contains "{greeting}" in somewhere
pptx_template --out out.pptx --template test.pptx --model model.json- Python 3.10, 3.11, 3.12, or 3.13
- uv (recommended) or pip
git clone https://github.com/m3dev/pptx-template.git
cd pptx-template
# Using uv (recommended)
uv sync --extra dev
# Or using pip
pip install -e ".[dev]"# Using uv
uv run --extra dev pytest
# Or with a specific Python version
uv run --python 3.13 --extra dev pytest
# Using pip (after installation)
pytest# Using uv
uv run pptx_template \
--template test/data3/in.pptx \
--model test/data3/in.xlsx \
--out test/data3/out.pptx \
--debug
# After pip install
pptx_template \
--template test/data3/in.pptx \
--model test/data3/in.xlsx \
--out test/data3/out.pptx \
--debuguv run pythonimport sys
from importlib import reload
import pptx_template.cli as cli
# Set arguments
sys.argv = ['dummy.py', '--out', 'test/data3/out.pptx', '--template', 'test/data3/in.pptx', '--model', 'test/data3/in.xlsx', '--debug']
# Run
cli.main()
# After modifying source code, reload and run again
reload(sys.modules.get('pptx_template.xlsx_model'))
reload(sys.modules.get('pptx_template.text'))
reload(sys.modules.get('pptx_template.table'))
reload(sys.modules.get('pptx_template.chart'))
reload(sys.modules.get('pptx_template.core'))
reload(sys.modules.get('pptx_template.cli'))
cli.main()- Create a feature branch
- Implement the new feature
- Test with all versions of Python (3.10, 3.11, 3.12, 3.13)
- Push changes to the feature branch
- Create a Pull Request on GitHub
- Request a code review
- Verify QA
- Merge Pull Request
- Upload to PyPI (Only for PyPI repository administrators)
# Build
uv build
# Upload to PyPI
uv publish
