Skip to main content

a command line interface to jinja;

Project description

jinja-cli

a command line interface to jinja;

this program renders a jinja template with given data; data may be read from a file, or defined as command line arguments; either template or data file may be stdin; output file may be stdout;

supported data formats: ini, json, xml, yaml;

install

pip install jinja-cli

usage

usage: jinja [options] [template]

a command line interface to jinja;

positional arguments:
    [template]                 template file;

optional arguments:
    -h|--help                  display help message;
    -D|--define {key} {value}  define data;
    -d|--data {file}           data file;
    -f|--format {format}       data format;
    -o|--output {file}         output file;

usage example

template file example.j2:

sheep eat {{ sheep.eat }};

data file example.json:

{
    "sheep": {
        "eat": "grass"
    }
}

any of these commands:

# jinja -d example.json example.j2
# jinja -d example.json < example.j2
# jinja -d - -f json example.j2 < example.json

output:

sheep eat grass;

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 jinja-cli, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size jinja-cli-1.0.3.tar.gz (6.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page