Skip to main content

makejinja

makejinja logo

PyPI | Docker | Docs | Example | Jinja reference

Generate entire directory structures using Jinja templates with support for external data and custom plugins.

makejinja demonstration


makejinja can be used to automatically generate files from Jinja templates. It is conceptually similar to Ansible templates since both are built on top of Jinja. However, makejinja is a standalone tool that can be used without Ansible and offers some advanced features like custom plugins.

A popular use case is generating config files for Home Assistant: Using the same Jinja language that Home Assistant's built-in templates use, you can greatly simplify your configuration management. makejinja's custom delimiter support prevents conflicts with Home Assistant's own template syntax, while file-specific data loading enables modular dashboard and automation generation. Our comprehensive Home Assistant example demonstrates dashboard generation with custom plugins, multiple data sources, and advanced template organization.

Key Features

  • Multi-Source Data Integration: Load variables from YAML, TOML, and Python files, with support for file-specific data sources, per-file namespacing, and runtime variable injection.
  • Custom Template Delimiters: Configure Jinja delimiters (e.g., <% %> instead of {{ }}) to avoid conflicts with target file formats like Home Assistant, Kubernetes, or Terraform.
  • Flexible Directory Processing: Process multiple input directories with complex nested structures, preserving hierarchy while applying powerful template transformations.
  • Extensible Plugin System: Create custom plugins with filters, functions, data, tests, policies, extensions, and path filtering logic for specialized requirements.
  • Production-Ready: Comprehensive CLI interface, configuration file support, and Python library API for seamless workflow integration.

Use Cases

  • Configuration Management: Generate environment-specific configs (dev/staging/prod) from shared templates with different data sources.
  • Home Assistant Dashboards: Create complex dashboards and automations using Jinja syntax without conflicts. See our complete example.
  • Infrastructure as Code: Generate Kubernetes manifests, Terraform modules, or Docker Compose files with consistent patterns across environments.
  • Web Development: Generate HTML pages, CSS files, or JavaScript configs from data sources for static sites or multi-tenant applications.
  • Database Schemas: Create SQL migration scripts, database configurations, or ORM models based on structured schema definitions.
  • Network Configuration: Generate router configs, firewall rules, or network device settings from centralized network topology data.
  • Monitoring & Alerting: Create Grafana dashboards, Prometheus rules, or alerting configurations from service inventories.
  • Documentation & CI/CD: Create project docs, API specifications, or pipeline definitions from structured data sources.

Installation

The tool is written in Python and can be installed via uv, nix, and docker. It can be used as a CLI tool or as a Python library.

UV

makejinja is available on PyPI and can be installed via uv:

uv tool install makejinja
makejinja -i ./input -o ./output

Nix

makejinja is packaged in nixpkgs. To use the most recent version, you can run it via nix run:

nix run github:mirkolenz/makejinja -- -i ./input -o ./output

Alternatively, you can add this repository as an input to your flake and use makejinja.packages.${system}.default.

Docker

We automatically publish an image to the GitHub Container Registry. To use it, mount a directory to the container and pass the options as the command:

docker run --rm -v $(pwd)/data:/data ghcr.io/mirkolenz/makejinja:latest -i /data/input -o /data/output

Usage in Terminal / Command Line

In its default configuration, makejinja searches the input directory recursively for files ending in .jinja. It then renders these files and writes them to the output directory, preserving the directory structure. Our documentation contains a detailed description of all options and can also be accessed via makejinja --help.

Release files for makejinja 2.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for makejinja 2.9.1
File Size Uploaded
makejinja-2.9.1.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for makejinja 2.9.1
File Interpreter ABI Platform
makejinja-2.9.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.3 kB

Release files / makejinja-2.9.1.tar.gz

Download URL makejinja-2.9.1.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e151309d6635b90c83f87542cb2bfd0b57b572a222bd2fb5a38487c65e0344da
BLAKE2b-256 checksum
How to use checksums
e234534c3c69fe58e0777a58f5b456f69e3c8d84b0d10ec3d1d764f4f40966c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / makejinja-2.9.1-py3-none-any.whl

Download URL makejinja-2.9.1-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
574c4c01eec07a39f94b7b46fdbd1dac665ac165aad8947634315e452f6a59a6
BLAKE2b-256 checksum
How to use checksums
89920c7b7aa5584645be866f039812019375b28f356d6dad054af82d0b6b80a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.9.1 This release

2 release files

2.9.0

2 release files

2.8.3

2 release files

2.8.2

2 release files

2.8.1

2 release files

2.8.0

2 release files

2.7.2

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.5

2 release files

2.3.4

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page