Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elapouya/python-docx-template
Use a docx as a jinja2 template
https://github.com/elapouya/python-docx-template
Last synced: 3 days ago
JSON representation
Use a docx as a jinja2 template
- Host: GitHub
- URL: https://github.com/elapouya/python-docx-template
- Owner: elapouya
- License: lgpl-2.1
- Created: 2015-03-12T12:52:14.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-05-21T17:03:50.000Z (7 months ago)
- Last Synced: 2024-05-22T00:03:52.095Z (7 months ago)
- Language: Python
- Size: 3.71 MB
- Stars: 1,889
- Watchers: 54
- Forks: 371
- Open Issues: 119
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-ccamel - elapouya/python-docx-template - Use a docx as a jinja2 template (Python)
README
====================
python-docx-template
====================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 docxpython-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 example 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 `_
Other projects
--------------If you like python-docx-template, please have a look at some of my other projects :
- `django-listing `_ : A listing/table library on steroid for Djano
- `python-textops3 `_ : Chainable text operations
- `django-robohash-svg `_ : Create svg robots avatars