Skip to main content

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

https://raw.githubusercontent.com/kwlo/python-pptx-templater/master/docs/static/images/sample_input.png

Using Template JSON:

{
    'slides': [
        {
            'layoutSlideNum': 0,
            'text': {
                'name': 'Paul'
            }
        },
        {
            'layoutSlideNum': 0,
            'text': {
                'name': 'Joe'
            }
        },
        {
            'layoutSlideNum': 1,
            'text': {
                'dog': {
                    'name': 'John Cena'
                }
            }
        },
    ]
}

Output

https://raw.githubusercontent.com/kwlo/python-pptx-templater/master/docs/static/images/sample_output.png

Install

pip install python-pptx-templater

Usage

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)

Metadata

Release files for python-pptx-templater 1.1.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-pptx-templater 1.1.15
File Size Uploaded
python-pptx-templater-1.1.15.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-pptx-templater 1.1.15
File Interpreter ABI Platform
python_pptx_templater-1.1.15-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / python-pptx-templater-1.1.15.tar.gz

Download URL python-pptx-templater-1.1.15.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
47aba65b300499b0da4b466d3f8340713b597e0f5ea5be2b1559acc1fb15a83a
BLAKE2b-256 checksum
How to use checksums
0bf5d21c97fdde17744b89c90e131ebaf47470bc3951302d1467c9cedd3ddb0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7

Release files / python_pptx_templater-1.1.15-py3-none-any.whl

Download URL python_pptx_templater-1.1.15-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75bcf279d7cb510088fa0bc0602678d0735576b5218f9924d9096af2996f2460
BLAKE2b-256 checksum
How to use checksums
2705af74baa265449df217c382227197a03dfbf0205b4f33f299fa91d2439fb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

1.1.15 This release

2 release files

1.1.14

2 release files

1.1.13

2 release files

1.1.12

2 release files

1.1.11

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page