Skip to main content

jinja2 template renderer

Project description


jiren is an application that generates text from a template. The format of the template is based on jinja2.

PyPI PyPI - Python Version Build Status codecov

Read this in Japanese: 日本語


pip install jiren


Generate text

Generate text from a template using the jiren command. This command can read a template from stdin or files.

An example of reading a template from stdin:


echo "hello, {{ name }}" | jiren


hello, world

An example of reading a template from a file:


cat <<EOF >template.j2
hello, {{ name }}

jiren template.j2


hello, world

In this example, the template contains a variable called name. You can set values for variables in a template using program arguments passed to the jiren command. Note that the program arguments must be prefixed with --var..

If you want to know more about template format, please refer to jinja2 document ( ).

Variables in a template

You can use the help to check the variables defined in a template.


echo "{{ greeting }}, {{ name }}" | jiren --help


... (omitted)

variables: VAR.NAME
  --var.greeting VAR.GREETING

Default values

You can set default values for variables for which no values was specified. This is based on the jinja2 specification.


echo "{{ greeting }}, {{ name | default('world') }}" | jiren --var.greeting=hello


hello, world

Strict option

When using the --strict option, you must specify values for all variables.


echo "{{ greeting }}, {{ name }}" | jiren --strict --var.greeting=hello


... (omitted)

jiren: error: the following arguments are required:

Project details

Download files

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

Files for jiren, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size jiren-0.2.2-py3-none-any.whl (4.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size jiren-0.2.2.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page