Jinja2 templates for yaml. Make dynamic rules and configs.
Project description
YAML Jinja2 expressions
Renders Jinja2 expressions inside YAML file.
Install
pip install yaml-expressions
Examples
Load template from file
cfg/cfg.yml:
cfg:
test: "{{test}}"
from yex import Yex
yex = Yex('./cfg/')
print(yex.render_file('cfg.yml', test='passed'))
Output: {'cfg': {'test': 'passed'}}
Load template from string
from yex import Yex
print(yex.render_text('test: {{test}}', test='passed'))
Output: {'test': 'passed'}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yaml-expressions-0.1.1.tar.gz
(2.0 kB
view hashes)