ard.utils.io#
Functions
|
|
|
|
|
Recursively replace the value of a target key in a dictionary. |
|
Classes
|
- class ard.utils.io.Loader(stream)[source]#
-
- yaml_constructors = {'!include': <function Loader.include>, 'tag:yaml.org,2002:binary': <function SafeConstructor.construct_yaml_binary>, 'tag:yaml.org,2002:bool': <function SafeConstructor.construct_yaml_bool>, 'tag:yaml.org,2002:float': <function SafeConstructor.construct_yaml_float>, 'tag:yaml.org,2002:int': <function SafeConstructor.construct_yaml_int>, 'tag:yaml.org,2002:map': <function SafeConstructor.construct_yaml_map>, 'tag:yaml.org,2002:null': <function SafeConstructor.construct_yaml_null>, 'tag:yaml.org,2002:omap': <function SafeConstructor.construct_yaml_omap>, 'tag:yaml.org,2002:pairs': <function SafeConstructor.construct_yaml_pairs>, 'tag:yaml.org,2002:seq': <function SafeConstructor.construct_yaml_seq>, 'tag:yaml.org,2002:set': <function SafeConstructor.construct_yaml_set>, 'tag:yaml.org,2002:str': <function SafeConstructor.construct_yaml_str>, 'tag:yaml.org,2002:timestamp': <function SafeConstructor.construct_yaml_timestamp>, None: <function SafeConstructor.construct_undefined>}#
- ard.utils.io.load_yaml(filename, loader=<class 'ard.utils.io.Loader'>, return_path=False)[source]#
- Return type:
dict
- ard.utils.io.replace_key_value(target_dict, target_key, new_value, replace_none_only=True)[source]#
Recursively replace the value of a target key in a dictionary.
Parameters: - target_dict (dict): The dictionary to process. - target_key (str): The key whose value needs to be replaced. - new_value: The new value to assign to the target key. - replace_none_only (bool): if True, only 'None' values will be replaced.
Returns: - dict: The updated dictionary.
- Return type:
dict- Parameters:
target_dict (dict)
target_key (str)