Content and publishing · Independent · 21 Oct 2026

elapouya/python-docx-template

Use a docx as a jinja2 template

← Content and publishing
python-docx-template: Word document templates. Fills Microsoft Word files using Python and template tags.

In simple English

You often need to send customers formal Word documents filled with their own data. Writing code to build a Word document from scratch is painful and usually looks ugly. This tool lets you design your layout in Microsoft Word as you normally would. You then add special text tags inside that file for the data. Your Python script fills those tags and saves a finished copy.

What it is

A Python library that combines a document reader with a template engine (a system that fills blanks in a text file with data from a program). It takes a Word file and replaces your tags with real text, images or tables.

What it is good for

Generating invoices, certificates or contracts from a Python app without writing complex layout code.

Stars2.7k
LicenceLGPL-2.1
LatestNo tagged releasechecked 21 Oct 2026
Last code change2026-07-07
Written inPython
Setup effort
2 / 5
Payoff
4 / 5
Good
  • Design your document in Microsoft Word instead of writing code for every paragraph.
  • Supports complex layouts like tables, headers, footers and embedded pictures.
  • Uses familiar template tags so you can write loops and conditions right inside the document.
Watch for
  • Requires Python programming knowledge to set up and run.
  • Only works with the Word file format, so you cannot use it for plain text or PDFs directly.
  • The licence is LGPL-2.1 (a legal rule that allows you to use the code, but with specific conditions if you change the library itself).
Replaces

Writing custom script code to build Word files from scratch or filling forms by hand.

Works well with

Python (a popular programming language for scripts and web servers).

Similar repositories
  • python-openxml/python-docx5.7k stars

    The base library for reading and writing Word files, but without the template system.

  • carboneio/carbone2.1k stars

    A similar template engine for office files, but runs on Node.js instead of Python.

Also reviewed on Repo Radar
  • facebook/docusaurus67k stars

    A static site generator from Meta that turns Markdown files into a documentation website.

  • mkdocs/mkdocs23k stars

    Turns a folder of Markdown files into a documentation website, controlled by one settings file.

  • squidfunk/mkdocs-material28k stars

    Turns a folder of Markdown files into a searchable documentation website, with every formerly sponsor-only feature now included.

Install
source venv/bin/activate
pip install docxtpl

Independent: reviewed for Repo Radar outside the daily editions. Every independent repository

On Stack Radar: Business Operations & Legal › Contracts & E-Signature › Document Automation.

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.