zeffo / pytemplate

A multithreaded templating system for MS word.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pytemplate

A templating system for MS word. The data must be in a CSV file. The template document must be a docx file.

Notes on performance

With the test data (data.csv) and test template (template.docx), the main.py script managed to generate 1000 documents in 0.9116356s. With the same data and template, the threaded_main.py script managed to generate 1000 documents in 5.3929732s.

The main.py script uses asyncio and concurrent.Futures.ThreadPoolExecutor to render and save the documents concurrently. The threaded_main.py script uses threading.

Usage:

Command Line utility:

py main.py <csv file path> <template document> <output folder>

Dependancies

Python 3.8+

docxtpl module (You can install this from PyPI: https://pypi.org/project/docxtpl/)

About

A multithreaded templating system for MS word.


Languages

Language:Python 100.0%