Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Config files renderer based on Jinja2

Project Description

It renders template files with context loaded from simple INI-style config files. Config files support inheritance and interpolation.

Getting started

Install this package with pip:

$ pip install jingle

Check usage:

$ jingle --help

Run some examples:

$ jingle examples/hello.conf < examples/hello.j2

Config files

Jingle supports single-group INI config files. For example:

one = 1
two = dos
three = trzy

Interpolation

Basic interpolation is supported thanks to SafeConfigParser used under the hood:

name = Jon
surname = Snow
fullname = %(name)s %(surname)s

Inheritance

Config files can be inherited, or saying precisely included one into another with #inherit directive.

In defaults.conf:

host = 0.0.0.0
port = 3000

In production.conf:

#inherit defaults.conf
port = 80

Compiled config will use host: 0.0.0.0 and port: 80.

Of course interpolation works across inherited files.

Programatic usage

You can as well use the library programatically in your application. Here’s simple example:

from jingle import Template, Context

tpl = Template("Hello {{who}}!")
print tpl.render(Context("path/to/params.conf"))

License

Copyright (c) 2014 by Kris Kovalik.

Released under MIT license, check LICENSE file for details.

Release History

Release History

This version
History Node

0.2.1

History Node

0.2.0

History Node

0.1.0

History Node

0.0.10

History Node

0.0.9

History Node

0.0.8

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jingle-0.2.1.tar.gz (5.1 kB) Copy SHA256 Checksum SHA256 Source Dec 2, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting