https://github.com/kwlo/python-pptx-templater
Create customizable PowerPoint Presentation (.pptx) using a predefined layout template
https://github.com/kwlo/python-pptx-templater
jinja2 office powerpoint pptx python python3 template
Last synced: 6 months ago
JSON representation
Create customizable PowerPoint Presentation (.pptx) using a predefined layout template
- Host: GitHub
- URL: https://github.com/kwlo/python-pptx-templater
- Owner: kwlo
- License: mit
- Created: 2019-10-27T16:57:41.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-20T02:03:14.000Z (over 4 years ago)
- Last Synced: 2025-04-14T12:58:11.840Z (6 months ago)
- Topics: jinja2, office, powerpoint, pptx, python, python3, template
- Language: Python
- Homepage:
- Size: 474 KB
- Stars: 34
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
python-pptx-templater
=====================python-pptx-templater is a tool to create highly customizable PowerPoint presentation using the jinja template languages.
User specifies the layouts and placeholders and the template will render the presentation.Example
-------Input
.. image:: https://raw.githubusercontent.com/kwlo/python-pptx-templater/master/docs/static/images/sample_input.png
Using Template JSON:
.. code-block:: text
{
'slides': [
{
'layoutSlideNum': 0,
'text': {
'name': 'Paul'
}
},
{
'layoutSlideNum': 0,
'text': {
'name': 'Joe'
}
},
{
'layoutSlideNum': 1,
'text': {
'dog': {
'name': 'John Cena'
}
}
},
]
}Output
.. image:: https://raw.githubusercontent.com/kwlo/python-pptx-templater/master/docs/static/images/sample_output.png
Install
-------.. code-block:: text
pip install python-pptx-templater
Usage
-----.. code-block:: text
from pptx_templater.core import convert
def test_conversion():
currpwd = os.path.dirname(os.path.abspath(__file__))
srcpath = f'{currpwd}/fixtures/test_presentation_layout.pptx'
destpath = f'{currpwd}/test_outputs/updated.pptx'j = {
'slides': [
{
'layoutSlideNum': 0,
'text': {
'name': 'Paul'
}
},
{
'layoutSlideNum': 0,
'text': {
'name': 'Joe'
}
},
{
'layoutSlideNum': 1,
'text': {
'dog': {
'name': 'John Cena'
}
}
},
]
}convert(srcpath, destpath, j)