CLI to generate powerpoint slides from simple yaml file[s]
- pptx-builder-from-yaml
>= python3.4- python modules
click==7.0.0- python-pptx==0.6.16
PyYAML==3.13
pip install pptx-builder-from-yamlHere is a sample yaml file - Dummy.yml
$ 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.pptx-builder slide_yamls/ -pt pptx-templates/default.pptxNotes:
slide_yamls/is the directory that holdsyamlfiles for slides. Theyaml[s] must follow the schema defined in the code. Here is an exampleyamlfile.slide_yamlsare positional arguments and can accept files and directories. If a positional argument is a directory, it will try to build individualpptxwith eachyamlfiles in the same directory.--pptx-template-path | -ptis expecting either a directory or a pptx file. If it is a directory,pptx-builderwill 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 correspondinginttype to-msand-sloptions. A sample pptx template file can seen here pptx-templates.- The default
--new-slide-pathistmpdirectory and hence it depends on the operating system you run thepptx-builderon.
pptx-builder slide_yamls/dummy.yml -dm master_slides/default.pptx --validateAdd footer to pptx template file to pass with --pptx-template-path option
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.
git clone https://github.com/sukujgrg/pptx-builder-from-yaml.git
cd pptx-builder-from-yaml
pipenv install --dev
pipenv shell
pipenv graphcd pptx-builder-from-yaml/
tox .