Jinja2-templates inside YAML-files.
Project description
j2yaml
Jinja2-templates inside YAML-files. Simply trying to mimic cookiecutter or Ansible in how Jinja is parsed within YAML-files.
Install
pip install j2yaml
Usage Example
---
# test.yaml
foo: Demo
bar: "{{ testvar }}"
fez: "{{ foo }}"
# test.py
import j2yaml
with open('test.yaml') as file:
yml = file.read()
data = j2yaml.load(yml, {'testvar':'asd'})
print(data)
python test.py
{'foo': 'Demo', 'bar': 'asd', 'fez': 'Demo'}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
j2yaml-0.1.1.tar.gz
(14.6 kB
view hashes)
Built Distribution
j2yaml-0.1.1-py3-none-any.whl
(14.9 kB
view hashes)