Skip to main content

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


Download files

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

Files for pydocxtpl, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size pydocxtpl-0.2.1-py2.py3-none-any.whl (9.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pydocxtpl-0.2.1.tar.gz (9.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page