Skip to content

A simple utility for rendering Jinja templates using INI file(s)

License

Notifications You must be signed in to change notification settings

LightSoar/jinjawalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jinjawalk

A simple utility for rendering Jinja templates using INI file(s).

This utility will render a tree of Jinja templates using key-value pairs from configparser compatible INI/conf files.

Basic usage examples

Say you have a conf/ingredients.ini ini file:

[cake]
sugar = 1kg
flour = 2kg

and a collection of templates, path/to/templates/, one of which being recipe.txt:

mix {{ config['cake']['sugar'] }} sugar and {{ config['cake']['flour'] }} flour

then you can render then entire template tree using:

from jinjawalk import JinjaWalk

walker = JinjaWalk()
walker.walk('conf/ingredients.ini', 'path/to/templates/', 'path/to/output')

or alternatively, directly from the commandline:

./jinjawalk.py --conf=conf/ingredients.ini --source=path/to/templates --output=path/to/output

About

A simple utility for rendering Jinja templates using INI file(s)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages