A CLI interface to Jinja2
Project description
$ 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: auto, ini, json,
querystring, yaml, yml
-e EXTENSIONS, --extension=EXTENSIONS
extra jinja2 extensions to load
-D key=value Define template variable in the form of key=value
-s SECTION, --section=SECTION
Use only this section from the configuration
--strict Disallow undefined variables to be used within the
template
Optional YAML support
If PyYAML
is present, you can use YAML as an input data source.
$ pip install jinja2-cli[yaml]
Optional TOML support
If toml
is present, you can use TOML as an input data source.
$ pip install jinja2-cli[toml]
Optional XML support
If xmltodict
is present, you can use XML as an input data source.
$ pip install jinja2-cli[xml]
Optional HJSON support
If hjson
is present, you can use HJSON as an input data source.
$ pip install jinja2-cli[hjson]
Optional JSON5 support
If json5
is present, you can use JSON5 as an input data source.
$ pip install jinja2-cli[json5]
TODO
- Variable inheritance and overrides
- Tests!
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
Built Distribution
Close
Hashes for jinja2_cli_tddschn-0.9.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0c0bf6c5527c99da8b820adea64d217b25e233b37149e42defd71ee0ecf007a |
|
MD5 | 661602c106302c13c4a362c275c1f440 |
|
BLAKE2b-256 | 8c8d67f41fa3af213d265310f1f0497b3ed9d42c41666d94643ac82acf08b905 |