Skip to main content

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


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)

Uploaded Source

Built Distribution

j2yaml-0.1.1-py3-none-any.whl (14.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page