makejinja


Namemakejinja JSON
Version 2.8.1 PyPI version JSON
download
home_pageNone
SummaryGenerate entire directory structures using Jinja templates with support for external data and custom plugins
upload_time2025-07-28 06:45:49
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords jinja2 home-assistant hassio dashboard lovelace template generator cli tool library
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- markdownlint-disable MD033 MD041 -->
<h1><p align="center">makejinja</p></h1>

<p align="center">
  <img width="256px" alt="makejinja logo" src="https://raw.githubusercontent.com/mirkolenz/makejinja/main/assets/logo.png" />
</p>

<p align="center">
  <a href="https://pypi.org/project/makejinja/">PyPI</a> |
  <a href="https://github.com/users/mirkolenz/packages/container/package/makejinja">Docker</a> |
  <a href="https://mirkolenz.github.io/makejinja">Docs</a> |
  <a href="https://github.com/mirkolenz/makejinja/tree/main/tests/data">Example</a> |
  <a href="https://jinja.palletsprojects.com/en/3.1.x/templates">Jinja reference</a>
</p>

<p align="center">
  Generate entire directory structures using Jinja templates with support for external data and custom plugins.
</p>

<p align="center">
  <img alt="makejinja demonstration" src="https://mirkolenz.github.io/makejinja/assets/demo.gif" />
</p>

---

<!-- PDOC_START -->

makejinja can be used to automatically generate files from [Jinja templates](https://jinja.palletsprojects.com/en/3.1.x/templates).
It is conceptually similar to [Ansible templates](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_module.html) 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](https://www.home-assistant.io/):
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](https://github.com/mirkolenz/makejinja/tree/main/tests/data) 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 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](https://mirkolenz.github.io/makejinja/makejinja/plugin.html#Plugin) with filters, functions, 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](https://github.com/mirkolenz/makejinja/tree/main/tests/data).
- **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](https://pypi.org/project/makejinja/) and can be installed via `uv`:

```shell
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`:

```shell
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](https://ghcr.io/mirkolenz/makejinja).
To use it, mount a directory to the container and pass the options as the command:

```shell
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](https://mirkolenz.github.io/makejinja/makejinja/cli.html) contains a detailed description of all options and can also be accessed via `makejinja --help`.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "makejinja",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "jinja2, home-assistant, hassio, dashboard, lovelace, template, generator, cli, tool, library",
    "author": null,
    "author_email": "Mirko Lenz <mirko@mirkolenz.com>",
    "download_url": "https://files.pythonhosted.org/packages/39/52/e223393831921852afc4c3a1649178d5b400e3dc7d7b12decd4a7e01da53/makejinja-2.8.1.tar.gz",
    "platform": null,
    "description": "<!-- markdownlint-disable MD033 MD041 -->\n<h1><p align=\"center\">makejinja</p></h1>\n\n<p align=\"center\">\n  <img width=\"256px\" alt=\"makejinja logo\" src=\"https://raw.githubusercontent.com/mirkolenz/makejinja/main/assets/logo.png\" />\n</p>\n\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/makejinja/\">PyPI</a> |\n  <a href=\"https://github.com/users/mirkolenz/packages/container/package/makejinja\">Docker</a> |\n  <a href=\"https://mirkolenz.github.io/makejinja\">Docs</a> |\n  <a href=\"https://github.com/mirkolenz/makejinja/tree/main/tests/data\">Example</a> |\n  <a href=\"https://jinja.palletsprojects.com/en/3.1.x/templates\">Jinja reference</a>\n</p>\n\n<p align=\"center\">\n  Generate entire directory structures using Jinja templates with support for external data and custom plugins.\n</p>\n\n<p align=\"center\">\n  <img alt=\"makejinja demonstration\" src=\"https://mirkolenz.github.io/makejinja/assets/demo.gif\" />\n</p>\n\n---\n\n<!-- PDOC_START -->\n\nmakejinja can be used to automatically generate files from [Jinja templates](https://jinja.palletsprojects.com/en/3.1.x/templates).\nIt is conceptually similar to [Ansible templates](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_module.html) since both are built on top of Jinja.\nHowever, makejinja is a standalone tool that can be used without Ansible and offers some advanced features like custom plugins.\n\nA popular use case is generating config files for [Home Assistant](https://www.home-assistant.io/):\nUsing the same Jinja language that Home Assistant's built-in templates use, you can greatly simplify your configuration management.\nmakejinja's custom delimiter support prevents conflicts with Home Assistant's own template syntax, while file-specific data loading enables modular dashboard and automation generation.\nOur comprehensive [Home Assistant example](https://github.com/mirkolenz/makejinja/tree/main/tests/data) demonstrates dashboard generation with custom plugins, multiple data sources, and advanced template organization.\n\n## Key Features\n\n- **Multi-Source Data Integration**: Load variables from YAML, TOML, and Python files, with support for file-specific data sources and runtime variable injection.\n- **Custom Template Delimiters**: Configure Jinja delimiters (e.g., `<% %>` instead of `{{ }}`) to avoid conflicts with target file formats like Home Assistant, Kubernetes, or Terraform.\n- **Flexible Directory Processing**: Process multiple input directories with complex nested structures, preserving hierarchy while applying powerful template transformations.\n- **Extensible Plugin System**: Create custom [plugins](https://mirkolenz.github.io/makejinja/makejinja/plugin.html#Plugin) with filters, functions, and path filtering logic for specialized requirements.\n- **Production-Ready**: Comprehensive CLI interface, configuration file support, and Python library API for seamless workflow integration.\n\n## Use Cases\n\n- **Configuration Management**: Generate environment-specific configs (dev/staging/prod) from shared templates with different data sources.\n- **Home Assistant Dashboards**: Create complex dashboards and automations using Jinja syntax without conflicts. See our [complete example](https://github.com/mirkolenz/makejinja/tree/main/tests/data).\n- **Infrastructure as Code**: Generate Kubernetes manifests, Terraform modules, or Docker Compose files with consistent patterns across environments.\n- **Web Development**: Generate HTML pages, CSS files, or JavaScript configs from data sources for static sites or multi-tenant applications.\n- **Database Schemas**: Create SQL migration scripts, database configurations, or ORM models based on structured schema definitions.\n- **Network Configuration**: Generate router configs, firewall rules, or network device settings from centralized network topology data.\n- **Monitoring & Alerting**: Create Grafana dashboards, Prometheus rules, or alerting configurations from service inventories.\n- **Documentation & CI/CD**: Create project docs, API specifications, or pipeline definitions from structured data sources.\n\n## Installation\n\nThe tool is written in Python and can be installed via uv, nix, and docker.\nIt can be used as a CLI tool or as a Python library.\n\n### UV\n\nmakejinja is available on [PyPI](https://pypi.org/project/makejinja/) and can be installed via `uv`:\n\n```shell\nuv tool install makejinja\nmakejinja -i ./input -o ./output\n```\n\n### Nix\n\nmakejinja is packaged in nixpkgs.\nTo use the most recent version, you can run it via `nix run`:\n\n```shell\nnix run github:mirkolenz/makejinja -- -i ./input -o ./output\n```\n\nAlternatively, you can add this repository as an input to your flake and use `makejinja.packages.${system}.default`.\n\n### Docker\n\nWe automatically publish an image to the [GitHub Container Registry](https://ghcr.io/mirkolenz/makejinja).\nTo use it, mount a directory to the container and pass the options as the command:\n\n```shell\ndocker run --rm -v $(pwd)/data:/data ghcr.io/mirkolenz/makejinja:latest -i /data/input -o /data/output\n```\n\n## Usage in Terminal / Command Line\n\nIn its default configuration, makejinja searches the input directory recursively for files ending in `.jinja`.\nIt then renders these files and writes them to the output directory, preserving the directory structure.\nOur [documentation](https://mirkolenz.github.io/makejinja/makejinja/cli.html) contains a detailed description of all options and can also be accessed via `makejinja --help`.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Generate entire directory structures using Jinja templates with support for external data and custom plugins",
    "version": "2.8.1",
    "project_urls": {
        "Changelog": "https://github.com/mirkolenz/makejinja/releases",
        "Documentation": "https://mirkolenz.github.io/makejinja/makejinja/cli.html",
        "Homepage": "https://mirkolenz.github.io/makejinja/",
        "Issues": "https://github.com/mirkolenz/makejinja/issues",
        "Repository": "https://github.com/mirkolenz/makejinja"
    },
    "split_keywords": [
        "jinja2",
        " home-assistant",
        " hassio",
        " dashboard",
        " lovelace",
        " template",
        " generator",
        " cli",
        " tool",
        " library"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d044913ddb00db01c3b8a2b74649e712f31d8e8cb81d6f598ece574fc7cb8718",
                "md5": "2dbcc6493ab6f35c768fbea719b5b622",
                "sha256": "af5fc187dfb85d824052c22800d4bf683222b9cb55064b29005fc5d654f27645"
            },
            "downloads": -1,
            "filename": "makejinja-2.8.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2dbcc6493ab6f35c768fbea719b5b622",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 15786,
            "upload_time": "2025-07-28T06:45:47",
            "upload_time_iso_8601": "2025-07-28T06:45:47.804229Z",
            "url": "https://files.pythonhosted.org/packages/d0/44/913ddb00db01c3b8a2b74649e712f31d8e8cb81d6f598ece574fc7cb8718/makejinja-2.8.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3952e223393831921852afc4c3a1649178d5b400e3dc7d7b12decd4a7e01da53",
                "md5": "2f07ffc80e39a05a936ca31739d303f4",
                "sha256": "59c0626390103a6b314644bcd98349bebc9e28a59ab95f0deea2d8d6cb679d03"
            },
            "downloads": -1,
            "filename": "makejinja-2.8.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2f07ffc80e39a05a936ca31739d303f4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 18254,
            "upload_time": "2025-07-28T06:45:49",
            "upload_time_iso_8601": "2025-07-28T06:45:49.056338Z",
            "url": "https://files.pythonhosted.org/packages/39/52/e223393831921852afc4c3a1649178d5b400e3dc7d7b12decd4a7e01da53/makejinja-2.8.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-28 06:45:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mirkolenz",
    "github_project": "makejinja",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "makejinja"
}
        
Elapsed time: 0.48824s