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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
j2yaml-0.1.1-py3-none-any.whl
(14.9 kB
view details)
File details
Details for the file j2yaml-0.1.1.tar.gz.
File metadata
- Download URL: j2yaml-0.1.1.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8200056f40609057d88ec91d7e28ba46ac0cf1b700c7b065e5d82aad8e111bf0
|
|
| MD5 |
e63809a0fd8470d51958dd77e22cc218
|
|
| BLAKE2b-256 |
58f479464a43cd2f72975b2f3f22a2ca975ef9de175909afe29907448a43cb85
|
File details
Details for the file j2yaml-0.1.1-py3-none-any.whl.
File metadata
- Download URL: j2yaml-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07d8f058cc1759bea03968cfc9cb6573b1f231e48faa77bcdc0a6555bdd12229
|
|
| MD5 |
889fb4b0f66c5e8aa808cd974506771f
|
|
| BLAKE2b-256 |
be46f86cbfa848b69b023cbdce52146c98377c30fe24850e410fdc2b2d4014d7
|