iYAML is a YAML macro processor.
iYAML provides the following YAML tags:
!include- to include the content of the specified file, or files matching the given wildcard!env- to include the value of the specified environment variable
Install default version from the Python Package Index:
pip install iyaml
Here is an example of including files and environment variables:
foo:
greeting: !include greeting.txt
secret_token: !env TOKEN
bar: !include temlates/*.sqlTo load the YAML file use the following code:
import iyaml
data = iyaml.load("file.yaml")