yaml_include.funcs module¶
- yaml_include.funcs.load(obj: Any, loader_type: Type[_Loader | _CLoader], constructor: Constructor, inplace: bool = False, nested: bool = False) Any[source]¶
Recursively load and parse all
Datainstances insideobj.If
Constructor.autoloadisFalse,yaml.load()will not cause including files to be opened or read, in the situation, what returned byyaml.load()is an object withDatain it, and the files won’t be processed. Thus we use the function to open and parse those including files represented byDatainstances inside obj.- Parameters:
obj (Any) – object containers
Dataloader_type (Type[Union[_Loader, _CLoader]]) – use this type of PyYAML Loader to parse string in including file(s)
constructor (Constructor) – use this
Constructorto find/open/read including file(s)inplace (bool) – whether to make a in-place replacement for every
Constructorinstance inobjnested (bool) – whether to parse and load lower level include statement(s) inside
Constructorinstance
- Returns:
Parsed object
- Return type:
Any
- yaml_include.funcs.lazy_load(obj: Any, loader_type: Type[_Loader | _CLoader], constructor: Constructor, nested: bool = False) Generator[Any, None, Any][source]¶
Recursively load and parse all
Datainsideobjin generative mode.Almost the same as
load(), except that:The function returns a generator, it yields at every
Datainstance 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[_Loader, _CLoader]])
constructor (Constructor)
nested (bool)
- Return type:
Generator[Any, None, Any]