Skip to main content

CLI to generate powerpoint slides from simple yaml file[s]

Project description

pptx-builder-from-yaml

CLI to generate powerpoint slides from simple yaml file[s]

Dependencies to run the CLI

How to install?

https://pypi.org/project/pptx-builder-from-yaml/

pip install pptx-builder-from-yaml

How does a yaml file look like for generating pptx?

Here is a sample yaml file - Dummy.yml

How to use the CLI?

$ pptx-builder --help
Usage: pptx-builder [OPTIONS] YAML_PATHS...

  A powerpoint builder

  https://github.com/sukujgrg/pptx-builder-from-yaml

Options:
  -pt, --pptx-template-path PATH  [required]
  -ms, --master-slide-idx INTEGER
                                  [default: 0]
  -sl, --slide-layout-idx INTEGER
                                  [default: 6]
  -fs, --font-size INTEGER        [default: 32]
  -fn, --font-name TEXT           [default: Calibri]
  -ns, --dst-dir TEXT             [default: ./generated-pptx]
  -ta, --slide-txt-alignment [left|middle|right]
                                  [default: left]
  --validate                      Run yaml validation against schema
  --version                       Show the version and exit.
  --help                          Show this message and exit.

How to generate pptx[s]?

pptx-builder slide_yamls/ -pt pptx-templates/default.pptx

Notes:

  • slide_yamls/ is the directory that holds yaml files for slides. The yaml[s] must follow the schema defined in the code. Here is an example yaml file. slide_yamls are positional arguments and can accept files and directories. If a positional argument is a directory, it will try to build individual pptx with each yaml files in the same directory.
  • --pptx-template-path | -pt is expecting either a directory or a pptx file. If it is a directory, pptx-builder will chose one among all the pptx files found in the same directory. The pptx template file should be without any change to master slide index or in slide layout index. If there are any changes to master slide index or slide layout, you need to pass corresponding int type to -ms and -sl options. A sample pptx template file can seen here pptx-templates.
  • The default --new-slide-path is tmp directory and hence it depends on the operating system you run the pptx-builder on.

How to validate a yaml and then generate the PPTX?

pptx-builder slide_yamls/dummy.yml -dm master_slides/default.pptx --validate

FAQs

How can I add same footer to all pptx[s] built using the CLI?

Add footer to pptx template file to pass with --pptx-template-path option

How to get different backgrounds for the generated pptx files using the CLI?

Create different pptx template files with different backgrounds and pass it on to --pptx-template-path option. See this video on creating pptx template file.

How to setup development environment?

git clone https://github.com/sukujgrg/pptx-builder-from-yaml.git

cd pptx-builder-from-yaml

pipenv install --dev

pipenv shell

pipenv graph

How to run tests?

cd pptx-builder-from-yaml/

tox .

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-builder-from-yaml-0.0.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

pptx_builder_from_yaml-0.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file pptx-builder-from-yaml-0.0.0.tar.gz.

File metadata

  • Download URL: pptx-builder-from-yaml-0.0.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for pptx-builder-from-yaml-0.0.0.tar.gz
Algorithm Hash digest
SHA256 73e90022fde0950ee3ff4b985e60831214d24a6a0c7f978761e25624644d72e1
MD5 7c0a156e3eb52aed182c4e6512c16fa5
BLAKE2b-256 808fe4d446168230f5d68fa9bc35a222b499a0d15d539aa926c8b68cb4969021

See more details on using hashes here.

File details

Details for the file pptx_builder_from_yaml-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: pptx_builder_from_yaml-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for pptx_builder_from_yaml-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c6053b5a56f6e12a6d509c9559415089418aa14e7c5097d482eaa07945f8e79
MD5 880413c0cd8bba8f63a811e5cf494d2b
BLAKE2b-256 ef0c5ba99738909e081f9bedd4c554461488450c2765dbd3dcc377b983d53a15

See more details on using hashes here.

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