Skip to main content

PPTemp

PPTemp is a wrapper for python-pptx. It enables you to make powerpoint files in a simple python commands.

Installation

pip install git+https://github.com/Ameyanagi/pptemp

Usage

from pptemp import pptemp

# Initialization
presentation = pptemp()

# Initialization with template
presentation = pptemp(template="./sample/template.pptx")
    
# Title
presentation.add_title_slide("Title", "Subtitle")

# Create Blank Slide with title on the top
presentation.add_content_slide("Title of the slide")

# Create slides from figures
presentation.add_figure_slide()

# Create slides from figures with label
# Set use_bar=False if you don't want the bars to appear
presentation.add_figure_label_slide(dir_path="./sample/fig/*/")

presentation.add_figure_label_slide(dir_path="./sample/fig/*/", use_label=False)

# Save
presentation.save("./test.pptx")

add_figure_label_slide()

add_figure_slide() and add_figure_label_slide() are use to import figures automatically from the "./fig" directory.

It will search figures specified by dir_path and img_path.

dir_path = "./fig/*/"
img_path = "*.png"

By Default, the title of the slides are taken from the dir_path and img_path."_" and "." are used as a separator.

If dir_path = "./fig/01_test/", then the title will be "test".
If img_path = "01_test.png", then the label will be "test".

To change where to look for the title and label, you can use the following arguments.

file_regex = re.compile(r".*[_/\\](.*)\.[a-zA-Z]+")
dir_regex = re.compile(r".*[_/\\](.*)[/\\]")

Samples

# Basic sample
python sample1.py

# Samples using template-slides
# You need to prepare template pptx files without any slides. If there is a slide, new slides will be appended.
python sample2_using_template.py

Metadata

Release files for pptemp 0.1.0

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

Source distribution (sdist)

Source distribution for pptemp 0.1.0
File Size Uploaded
pptemp-0.1.0.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pptemp 0.1.0
File Interpreter ABI Platform
pptemp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.9 kB

Release files / pptemp-0.1.0.tar.gz

Download URL pptemp-0.1.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
83eaa9673de8d712f8f4f5a9329b35dabccfd91a757dd0575147a79b72b761cf
BLAKE2b-256 checksum
How to use checksums
60a34bec24ce0cf7177510470414c98a366d0ecac8042eada3a1784f014bde01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / pptemp-0.1.0-py3-none-any.whl

Download URL pptemp-0.1.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7636f322e23c7f1ce29e1a95291d7d15432f2811ad0107758366f3f96ecff0a
BLAKE2b-256 checksum
How to use checksums
a81104396275223ff5449e88032d51527f7fb4513679936f70f1a11594ebc53e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

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