A python module to generate docx files from a docx template
Project description
pydocxtpl
A docx templater.
How to install
pip install pydocxtpl
How to use
To use pydocxtpl, you need to be familiar with the syntax of jinja2 template.
- code sample
from pydocxtpl import DocxWriter
person_info = {'address': u'', 'name': u'', 'pic': '1.jpg'}
person_info2 = {'address': u'Somewhere over the rainbow', 'name': u'Hello Wizard', 'pic': '0.jpg'}
persons = [person_info, person_info2]
payload = {'persons': persons}
writer = DocxWriter('test.docx')
writer.render(payload)
writer.save('test_result.docx')
See examples.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pydocxtpl-0.2.tar.gz
(9.3 kB
view hashes)
Built Distribution
Close
Hashes for pydocxtpl-0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1964f722a447dcabd4fdf16fc69ba22b486e86ab4947e1de1eab6171f0e1623a |
|
MD5 | f55e97ebb909defe35f9cf412bc5c255 |
|
BLAKE2b-256 | 2f2dbbd2f2b6dcdf73177318777293b90c88a22ce0e00b0e3910ece232a61131 |