• Stars
    star
    471
  • Rank 92,595 (Top 2 %)
  • Language
    Python
  • License
    BSD 2-Clause "Sim...
  • Created over 12 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CLI for Jinja2

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

More Repositories

1

django-sudo

Extra security for your sensitive pages
Python
277
star
2

colors.py

Colors aren't that scary!
Python
231
star
3

ec2

Sugar on top of boto for accessing EC2 instances and security groups
Python
140
star
4

proofread

Test your Django app without writing tests!
Python
89
star
5

email-me

email me when a thing is done
Go
53
star
6

sourcemap-validator

Service for validating sourcemaps
Python
51
star
7

node-snsclient

Client for Amazon AWS's SNS service
JavaScript
46
star
8

node_nibbler

Base32/base64 encode/decode library for Node
JavaScript
43
star
9

go-celery

WIP
Go
42
star
10

python-sourcemap

Parse JavaScript source maps
Python
39
star
11

jwt-node

Adapt jwt-js for use in Node.js, nothing special.
JavaScript
30
star
12

sentry-twilio

A plugin for Sentry that sends SMS notifications via Twilio
Python
22
star
13

size

A package for working with byte capacities similar to time.Duration
Go
21
star
14

firewall

Punch a hole into an AWS EC2 security group temporarily
Python
19
star
15

go-memcached

Memcached library for Go
Go
19
star
16

UT2k4-Mods

Unreal Tournament 2004 Maps and Characters
Shell
17
star
17

semaphore

A Go semaphore primitive
Go
17
star
18

go-bubs

β’·β“Šβ’·β’·β“β’Ίβ“ˆ ⒾⓃ β’Όβ“„
Go
16
star
19

mywsgi

Opinionated uWSGI setup
Python
15
star
20

node_pickle

A really, admittedly, lazy interface into Python for pickling/unpickling an object.
JavaScript
12
star
21

django-snippets

Just a bunch of small reusable snippets for projects. Middlewares, decorators, templatetags, etc.
Python
11
star
22

sentry-sprintly

A plugin for Sentry that creates Sprint.ly defects out of exceptions
Python
9
star
23

envtpl

Render a template from environment variables
Go
9
star
24

envdir-plusplus

kinda like envdir, kinda like dotenv, kinda like docker env-file
Go
9
star
25

docker-ut2004

Unreal Tournament 2004 Dedicated Server
Smarty
8
star
26

https

https proxy for local testing
Go
8
star
27

go-randid

Alternative random id generation to uuid
Go
7
star
28

connect-access

Access controls (ACLs) by location as a Connect middleware
JavaScript
7
star
29

whichpkg

Locate the path of a specific python module
Python
7
star
30

go-httpheaders

Canonicalized forms of common HTTP headers for Go
Go
7
star
31

python-stathat

A better Python library for StatHat
Python
7
star
32

node_signedcookies

Middleware for Express to sign/unsign cookies with a secret key.
JavaScript
6
star
33

node-mock-udp

Mocking and testing for UDP
JavaScript
5
star
34

sentry-groveio

A plugin for Sentry that logs errors to an IRC room on Grove.io
Python
5
star
35

pgtobq

postgres table -> bigquery table
Go
5
star
36

python-bandpage

The Python library for BandPage.
Python
5
star
37

breadsticks

Boom, you got breadsticks.
Python
5
star
38

ember

experiments with my ember mug
Python
4
star
39

python-zohodocs

Wrapper for Zoho Docs (Writer, Sheet, Show)
Python
4
star
40

twilio-js

Javascript library for Twilio
JavaScript
4
star
41

blart

to observe and report
Go
4
star
42

django-registration

Merge of https://bitbucket.org/ColeVsCode/django-registration/ & https://bitbucket.org/ubernostrum/django-registration
Python
4
star
43

tracker

Exploration with a BitTorrent tracker in Python
Python
3
star
44

emptygif

A little module for serving up an empty 1x1 transparent gif
Go
3
star
45

s3autoindex

autoindex for private s3 buckets
Go
3
star
46

django-locking-south

Prevent South from running concurrently
Python
3
star
47

nginx-and

run nginx... and something else!
Go
3
star
48

imgur-cli

upload clipboard data to imgur
Objective-C
3
star
49

python-svnserve

I'm trying to emulate the svn protocol with the Pythons
Python
3
star
50

libvmod-shards

Shell
3
star
51

jquery-sprite-plugin

Animate a sprite sheet with jQuery
JavaScript
2
star
52

connect-brotli

brotli compression for connect-go
Go
2
star
53

sentry-proxy

Go
2
star
54

python-casscache

Python
2
star
55

weather.withmatt.com

JavaScript
2
star
56

go-memcached-siege

Trying to break memcached.
Go
2
star
57

AS3-Classes

My collection of AS3 classes I wrote years ago
ActionScript
2
star
58

mattrobenolt.github.com

CSS
2
star
59

docker-twemproxy

Twemproxy (nutcracker)
Shell
1
star
60

node-redisq

A wrapper for simple Redis pub/sub in Node
JavaScript
1
star
61

callsite-shim

A shim for other browsers to conform to the CallSite API
JavaScript
1
star
62

python-npm

Python
1
star
63

hosthash

1
star
64

redis-py-contrib

Missing contrib packages for redis-py
Python
1
star
65

7languages

7 languages, 7 weeks, 1 man.
Ruby
1
star
66

update-maxmind

A little library that should be run on a cronjob to update the free MaxMind GeoIP libraries.
Python
1
star
67

withmatt.com

1
star
68

docker-vault

docker images for hashicorp's vault
Makefile
1
star
69

drunk-javascript

wtf Javascript exceptions
1
star
70

commands.py

Awesome python CLI shit, I think.
Python
1
star
71

mime.types

A collection of some normal filetypes for use in Python or Apache.
1
star
72

inboxb.in

1
star
73

jsonpd

jsonp -> esi
Go
1
star
74

django-proofread

Moved to https://github.com/mattrobenolt/proofread
1
star
75

twilio-node

A Node.js module for communicating with the Twilio API and generating TwiML
JavaScript
1
star
76

sublime-text-json-prettifier

1
star