1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-pyyaml-env-tag
7 SDESC[py310]= YAML tag for environment variables (3.10)
8 SDESC[py311]= YAML tag for environment variables (3.11)
9 HOMEPAGE= https://github.com/waylan/pyyaml-env-tag
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPIWHL/5a/66/bbb1dd374f5c870f59c5bb1db0e18cbe7fa739415a24cbd95b2d1f5ae0c4
14 DISTFILE[1]= pyyaml_env_tag-0.1-py3-none-any.whl:main
19 OPTIONS_AVAILABLE= PY310 PY311
20 OPTIONS_STANDARD= none
21 VOPTS[py310]= PY310=ON PY311=OFF
22 VOPTS[py311]= PY310=OFF PY311=ON
24 DISTNAME= pyyaml_env_tag-0.1.dist-info
28 [PY310].RUN_DEPENDS_ON= python-PyYAML:single:py310
29 [PY310].USES_ON= python:py310,wheel
31 [PY311].RUN_DEPENDS_ON= python-PyYAML:single:py311
32 [PY311].USES_ON= python:py311,wheel
34 [FILE:2233:descriptions/desc.single]
37 A custom YAML tag for referencing environment variables in YAML files.
41 Install `PyYAML` and the `pyyaml_env_tag` package with pip:
44 pip install pyyaml pyyaml_env_tag
49 To enable the tag, import and add the `construct_env_tag` constructor to
55 from yaml_env_tag import construct_env_tag
57 yaml.Loader.add_constructor('!ENV', construct_env_tag)
60 Then you may use the loader as per usual. For example:
63 yaml.load(data, Loader=yaml.Loader)
68 Include the tag `!ENV` followed by the name of an environment variable in a
70 file and the value of the environment variable will be used in its place.
73 key: !ENV SOME_VARIABLE
76 If `SOME_VARIABLE` is set to `A string!`, then the above YAML would result
78 following Python object:
84 The content of the variable is parsed using YAML's implicit scalar types,
86 string, bool, integer, float, datestamp and null. More complex types are
88 recognized and simply passed through as a string. For example, if
90 was set to the string `true`, then the above YAML would result in the
97 If the variable specified is not set, then a `null` value is assigned as a
99 You may define your own default as the last item in a sequence.
102 key: !ENV [SOME_VARIABLE, default]
105 In the above example, if `SOME_VARIABLE` is not defined, the string
107 be used instead, as follows:
113 You may list multiple variables as fallbacks. The first variable which is
115 used. In any sequance with more than one item, the last item must always be
117 default value and will not be resolved as an environment variable.
120 key: !ENV [SOME_VARIABLE, FALLBACK, default]
123 As with variable contents, the default is resolved to a Python object of
125 implied type (string, bool, integer, float, datestamp and null).
127 When `SOME_VARIABLE` is not set, all four of the following items will
129 the same value (`None`):
133 - !ENV [SOME_VARIABLE]
134 - !ENV [SOME_VARIABLE, ~]
138 af31106dec8a4d68c60207c1886031cbf839b68aa7abccdb19868200532c2069 3911 pyyaml_env_tag-0.1-py3-none-any.whl