GithubHelp home page GithubHelp logo

wifasoi / jinja2-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattrobenolt/jinja2-cli

0.0 2.0 0.0 49 KB

CLI for Jinja2

License: BSD 2-Clause "Simplified" License

Makefile 1.30% Python 98.70%

jinja2-cli's Introduction

$ 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]

TODO

  • Variable inheritance and overrides
  • Tests!

jinja2-cli's People

Contributors

iljabauer avatar jenselme avatar lgtml avatar mattrobenolt avatar michilu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.