使用预定义的布局模板创建可自定义的 PowerPoint 演示文稿 (.pptx)
项目描述
python-pptx-templater 是一个使用 jinja 模板语言创建高度可定制的 PowerPoint 演示文稿的工具。用户指定布局和占位符,模板将呈现演示文稿。
例子
输入
使用模板 JSON:
{
'slides': [
{
'layoutSlideNum': 0,
'text': {
'name': 'Paul'
}
},
{
'layoutSlideNum': 0,
'text': {
'name': 'Joe'
}
},
{
'layoutSlideNum': 1,
'text': {
'dog': {
'name': 'John Cena'
}
}
},
]
}
输出
安装
pip install python-pptx-templater
用法
from pptx_templater.core import convert
def test_conversion():
currpwd = os.path.dirname(os.path.abspath(__file__))
srcpath = f'{currpwd}/fixtures/test_presentation_layout.pptx'
destpath = f'{currpwd}/test_outputs/updated.pptx'
j = {
'slides': [
{
'layoutSlideNum': 0,
'text': {
'name': 'Paul'
}
},
{
'layoutSlideNum': 0,
'text': {
'name': 'Joe'
}
},
{
'layoutSlideNum': 1,
'text': {
'dog': {
'name': 'John Cena'
}
}
},
]
}
convert(srcpath, destpath, j)
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
python-pptx-templater-1.1.15.tar.gz
(3.5 kB
查看哈希)
内置分布
关
python_pptx_templater -1.1.15-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 75bcf279d7cb510088fa0bc0602678d0735576b5218f9924d9096af2996f2460 |
|
MD5 | 2d4a83892cd86b5552e6d6fc15ea8f04 |
|
布莱克2-256 | 2705af74baa265449df217c382227197a03dfbf0205b4f33f299fa91d2439fb5 |