Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

makejinja

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

makejinja

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

  • 2.7.2
  • PyPI
  • Socket score

Maintainers
1

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

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 use case for this tool is generating config files for Home Assistant: Using the same language that the built-in templates use, you can greatly simplify your configuration. An example for Home Assistant can be found in the tests directory.

Highlights

  • Recursively render nested directories containing template files to a common output directory.
  • Load data files containing variables to use in your Jinja templates from YAML, TOML, and Python files.
  • Write custom plugins to extend the functionality of makejinja.
  • Adjust all Jinja options (e.g., whitespace behavior and delimiters) to your needs via CLI flags or a config file.

Installation

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

PIP

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

pip install makejinja
makejinja -i ./input -o ./output

Nix

If you use the nix package manager, you can add this repository as an input to your flake and use makejinja.packages.${system}.default or apply the overlay makejinja.overlays.default. You can also run it directly as follows:

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

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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc