Skip to content

allanlei/jinja2-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

$ jinja2

A CLI interface to Jinja2

$ jinja2 helloworld.tmpl data.json --format=json
$ cat data.json | jinja2 helloworld.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl
$ curl -s http://httpbin.org/ip | jinja2 helloip.tmpl > helloip.html

Install

$ pip install jinja2-cli

Usage

Usage: jinja2 [options] <input template> <input data>

Options:
  --version        show program's version number and exit
  -h, --help       show this help message and exit
  --format=FORMAT  Format of input variables: yaml, json, querystring, ini

Optional YAML support

If PyYAML is present, you can use YAML as an input data source.

$ pip install pyyaml

TODO

  • Variable inheritance and overrides
  • Make environment variables accessible to templates
  • Pass through m4/gcc-like variables: jinja2 -Dname=matt
  • Tests!

About

CLI for Jinja2

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.1%
  • Makefile 0.9%