PowerPoint演示文稿生成器使用模板.pptx(不支持cli)

pptx-template-simple的Python项目详细描述


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:

frompptx_templateimportrenderinput_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
  • 取决于python2或3pandas,pptx
  • 处理的json和csv的字符代码是以utf-8为前提

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
构造函数的java条件调用   类Dog中的java构造函数Dog不能应用于给定类型   java jsch和运行“sudo su”   java将队列和堆栈相互复制   java如何在netbeans项目的文件夹中添加库   java While循环在我的代码中不存在   如何在XML中使用java方法的返回值   java是否可以在不写入文件的情况下将字符串/字节数组作为文件发布?   java为什么这些字符串不相等?   sockets客户机-服务器java编程,用户可选择   java如何在SpringMVC和hibernate中保存模型返回视图的列表   java如何修复组织。openqa。硒。WebDriverException:未知错误   Java,Ant错误:编码Cp1252的不可映射字符   JAVAlang.ClassCastException:[Ljava.lang.String;与java.lang.String不兼容   java如何使用JDK8(可选)为空字段创建自定义IntelliJ getter模板   java Tomcat6响应。sendRedirect()404错误