aea.helpers.yaml_
utils
Helper functions related to YAML loading/dumping.
_
AEAYamlLoader Objects
Custom yaml.SafeLoader for the AEA framework.
It extends the default SafeLoader in two ways: - loads YAML configurations while remembering the order of the fields; - resolves the environment variables at loading time.
This class is for internal usage only; please use the public functions of the module 'yaml_load' and 'yaml_load_all'.
__
init__
Initialize the AEAYamlLoader.
It adds a YAML Loader constructor to use 'OderedDict' to load the files.
Arguments:
args
: the positional arguments.kwargs
: the keyword arguments.
_
AEAYamlDumper Objects
Custom yaml.SafeDumper for the AEA framework.
It extends the default SafeDumper so to dump YAML configurations while following the order of the fields.
This class is for internal usage only; please use the public functions of the module 'yaml_dump' and 'yaml_dump_all'.
__
init__
Initialize the AEAYamlDumper.
It adds a YAML Dumper representer to use 'OderedDict' to dump the files.
Arguments:
args
: the positional arguments.kwargs
: the keyword arguments.
yaml_
load
Load a yaml from a file pointer in an ordered way.
Arguments:
stream
: file pointer to the input file.
Returns:
the dictionary object with the YAML file content.
yaml_
load_
all
Load a multi-paged yaml from a file pointer in an ordered way.
Arguments:
stream
: file pointer to the input file.
Returns:
the list of dictionary objects with the (multi-paged) YAML file content.
yaml_
dump
Dump YAML data to a yaml file in an ordered way.
Arguments:
data
: the data to write.stream
: (optional) the file to write on.
yaml_
dump_
all
Dump YAML data to a yaml file in an ordered way.
Arguments:
data
: the data to write.stream
: (optional) the file to write on.