yaml_include.funcs module¶
- yaml_include.funcs.load(obj: Any, loader_type: Type[YAML_Loader | YAML_CLoader], constructor: Constructor, inplace: bool = False, nested: bool = False) Any [source]¶
Recursively load and parse all
Data
instances insideobj
.If
Constructor.autoload
isFalse
,yaml.load()
will not cause including files to be opened or read, in the situation, what returned byyaml.load()
is an object withData
in it, and the files won’t be processed. Thus we use the function to open and parse those including files represented byData
instances inside obj.- Parameters:
obj (Any) – object containers
Data
loader_type (Type[Union[YAML_Loader, YAML_CLoader]]) – use this type of PyYAML Loader to parse string in including file(s)
constructor (Constructor) – use this
Constructor
to find/open/read including file(s)inplace (bool) – whether to make a in-place replacement for every
Constructor
instance inobj
nested (bool) – whether to parse and load lower level include statement(s) inside
Constructor
instance
- Returns:
Parsed object
- Return type:
Any
- yaml_include.funcs.lazy_load(obj: Any, loader_type: Type[YAML_Loader | YAML_CLoader], constructor: Constructor, nested: bool = False) Generator[Any, None, Any] [source]¶
Recursively load and parse all
Data
insideobj
in generative mode.Almost the same as
load()
, except that:The function returns a generator, it yields at every
Data
instance found in sideobj
.It only applies an in-place parsing and replacement, and will not return parsed object.
- Parameters:
obj (Any)
loader_type (Type[Union[YAML_Loader, YAML_CLoader]])
constructor (Constructor)
nested (bool)
- Return type:
Generator[Any, None, Any]