Skip to main content

Render ppt like a jupyter notebook

Reason this release was yanked:

Released a full version instead of beta

Project description

PPTX Renderer

This package let's you run your powerpoint presentations like a jupyter-notebook. You can insert placeholders in the ppt and also write python code in the ppt's notes and use either a python function or an equivalent commandline tool to convert it into an output rendered presentation.

Below is a simple example.

from pptx_renderer import PPTXRenderer
p = PPTXRenderer("template.pptx")

someval = "hello"
def mymethod(abc):
    return f"{abc} " * 5

myimage = r"is_it_worth_the_time.png"
mytable = [["a", "b", "c", "d", "e"]] * 10
p.render(
    "output.pptx", 
    {
        "someval": someval, "mymethod": mymethod, "myimage": myimage,
        "mytable": mytable,
    }
)

This will convert this

Before

to this.

After

You can define some functions within the ppt itself by writing python code in the notes section of slides. And the variables and functions in this code can be used in the main ppt.

For example: write the following in one of the slide's notes.

```python
def myfunc(input):
    return input * 42
```

Now you can, for example, add the placeholder {{{myfunc(42)}}} in your slides.

If the template ppt is a self contained python script ie: if it does not require variable values and function definition to be passed from outside, you can generate the output ppt directly from the commandline using the following command.

pptx-renderer input_template.pptx output_file.pptx

Installation

pip install pptx-renderer

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

pptx_renderer-0.1.0.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

pptx_renderer-0.1.0-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

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