Skip to main content

Jinja2 Template CLI

Project description

Render Jinja2 templates on the command line using a YAML, JSON or HCL file as input for the render context.

Installation

j2y is installed using pip:

pip install j2y

Alternatively you can install directly from Github master branch:

pip install git+https://github.com/chaudum/j2y.git@master

Usage

By default, j2y takes a YAML file as input:

j2y template.j2 < values.yaml

Alternatively you can use JSON or HCL as input format:

j2y template.j2 -f json < values.json

j2y template.j2 -f hcl < values.hcl

Run j2y -h to see all available options.

Local Development

Bootstrapping

Create a virtualenv and install the package as develop egg:

$ python -m venv env
$ env/bin/activate
(env) $ pip install -e .

Tests

At the moment there are very simple test cases only. Test are written as native Python doctests. You can invoke them like so:

(env) $ python j2y/tests.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

j2y-0.1.0.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

j2y-0.1.0-py2.py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page