I'm trying to load a yaml file in jinja2 format and "evaluate"/"render" the template. Here, the example:
{% set name = "pyexcel-ezodf" %}
{% set version = "0.3.3" %}
package:
name: {{ name|lower }}
version: {{ version }}
I would like to be able to load the yaml file and said yaml['package']['version']=0.3.3
I have to try ruamel YAML but it doesn't evaluate the version only give me a package.
here the python code:
yaml = YAML(typ='jinja2')
yaml.allow_duplicate_keys = True
yaml.explicit_start = True
yaml_content = yaml.load(content)
print (yaml_content['package'])