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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pptemp-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pptemp-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file pptemp-0.1.0.tar.gz.

File metadata

  • Download URL: pptemp-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pptemp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83eaa9673de8d712f8f4f5a9329b35dabccfd91a757dd0575147a79b72b761cf
MD5 eac5d91181c4498665d19439d0d53bba
BLAKE2b-256 60a34bec24ce0cf7177510470414c98a366d0ecac8042eada3a1784f014bde01

See more details on using hashes here.

File details

Details for the file pptemp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pptemp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pptemp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7636f322e23c7f1ce29e1a95291d7d15432f2811ad0107758366f3f96ecff0a
MD5 2e8688caf71184f87b414aefaa7e319b
BLAKE2b-256 a81104396275223ff5449e88032d51527f7fb4513679936f70f1a11594ebc53e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page