Skip to main content

Python docx template engine

Project description

Use a docx as a jinja2 template

Introduction

This package uses 2 major packages :

  • python-docx for reading, writing and creating sub documents

  • jinja2 for managing tags inserted into the template docx

python-docx-template has been created because python-docx is powerful for creating documents but not for modifying them.

The idea is to begin to create an exemple of the document you want to generate with microsoft word, it can be as complex as you want : pictures, index tables, footer, header, variables, anything you can do with word. Then, as you are still editing the document with microsoft word, you insert jinja2-like tags directly in the document. You save the document as a .docx file (xml format) : it will be your .docx template file.

Now you can use python-docx-template to generate as many word documents you want from this .docx template and context variables you will associate.

Documentation

Please, read the doc

News

0.1.8 (2015-11-05)

  • better xml code cleaning around Jinja2 tags

0.1.7 (2015-09-09)

  • python 3 support

0.1.6 (2015-05-11)

  • remove debug code

  • add lxml dependency

0.1.5 (2015-05-11)

  • fix template filter with quote

0.1.4 (2015-03-27)

  • add RichText support

0.1.3 (2015-03-13)

  • add subdoc support

  • add some exemples in tests/

0.1.2 (2015-03-12)

  • First running version

Project details


Release history Release notifications | RSS feed

This version

0.1.8

Download files

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

Source Distribution

docxtpl-0.1.8.tar.gz (66.9 kB view details)

Uploaded Source

File details

Details for the file docxtpl-0.1.8.tar.gz.

File metadata

  • Download URL: docxtpl-0.1.8.tar.gz
  • Upload date:
  • Size: 66.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for docxtpl-0.1.8.tar.gz
Algorithm Hash digest
SHA256 f5fb63f90fd6ac1ca9e890ea0bf493793fbe865e45a4dd3ed1303dcce65b047a
MD5 7577a3c968ccd14a84ea4d0a09e92058
BLAKE2b-256 446d3124684ba49e691b233922d9ca63f21aa299197dc5e2ba0ab9f6e2661052

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page