Skip to main content

The PowerPoint presentation builder using template.pptx (without support in cli)

Project description

pptx-template

Getting started

The goal of this fork is to provide a PyPI package that you can use in your python project by calling the pptx_template.render.render_pptx function.

Some features provided by the originals projects (https://github.com/skar404/pptx-template and https://github.com/m3dev/pptx-template) may not work properly.

Install

pip3 install pptx_template_simple

In this fork, you can render a template like this:

from pptx_template import render

input_path = 'test/data5/in.pptx'
model = {
    "greeting": "Hello!",
    "client_name": "M. Melpanque"
}
output_path = 'test/data5/out.pptx'
render.render_pptx(input_path, model, output_path)

Development

Test manualy the package:

python3 main.py

Install dependencies:

sudo apt-get -y install python3-setuptools
pip3 install wheel
pip3 install twine

Build the package:

python3 setup.py bdist_wheel

Install the local build package:

pip3 install dist/pptx_template_simple-0.2.8-py3-none-any.whl

Upload to test pypi:

twine upload --repository testpypi dist/*

Then test your package by installing the test pypi package:

pip3 install --index-url https://test.pypi.org/simple/ --no-deps pptx_template_simple

When you are ready, upload the package in the main pypi repository:

twine upload dist/*

Tests

Install dependencies:

pip3 install pytest

Run tests:

pytest

TODO

  • Substitute images
  • Use Jinja template syntax

Overview

pptx-template is a PowerPoint presentation builder.

This helps your routine reporting work that have many manual copy-paste from excel chart to powerpoint, or so.

  • Building a new powerpoint presentation file from a "template" pptx file which contains "id"
  • Import some strings and CSV data which is defined in a JSON config file or a Python dict
  • "id" in pptx template is expressed as a tiny DSL, like "{sales.0.june.us}"
  • requires python envirionment (2 or 3), pandas, python-pptx
  • for now, only UTF-8 encoding is supported for json, csv

Text substitution

!

CSV Import

!

Japanese translation

pptx-template は pptx のテンプレートを元に、別途用意した JSON 中の文字列や CSV データを差し込んだ pptx を生成するツールです。

定型レポートなどで大量のグラフ付きスライドを作成する際の作業を代行してくれます。

  • テンプレートには "{sales.0.june.us}" のような形で JSON内の値を指す id を記入できます
  • python 2 または 3, pandas, pptx に依存しています
  • 扱う json や csv の 文字コードは utf-8 前提です

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pptx_template_simple-0.2.8.3-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file pptx_template_simple-0.2.8.3-py3-none-any.whl.

File metadata

  • Download URL: pptx_template_simple-0.2.8.3-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for pptx_template_simple-0.2.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 22a5426a470bcc785e0db9717d24e5c6e3d0fb267c043342af1d7c1e62a8023e
MD5 a6c25e557f347a331d99be41fe28f498
BLAKE2b-256 1e54a97eaf4ae2009e28194c68cc3dcb65edd4cce8261d54ded839bdc8b12922

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