h2integrate.core.dict_utils#
Functions
|
Recursive method to remove keys from a dictionary. |
|
Rename |
|
Recursive method to update all entries in a dictionary with key 'keyname' with value 'new_val' |
|
Recursive method to copy value of |
- h2integrate.core.dict_utils.update_defaults(orig_dict, keyname, new_val)#
Recursive method to update all entries in a dictionary with key ‘keyname’ with value ‘new_val’
- Parameters:
orig_dict (dict) – dictionary to update
keyname (str) – key corresponding to value to update
new_val (any) – value to use for
keyname
- Returns:
dict – updated version of orig_dict
- h2integrate.core.dict_utils.update_keyname(orig_dict, init_key, new_keyname)#
Recursive method to copy value of
orig_dict[init_key]toorig_dict[new_keyname]- Parameters:
orig_dict (dict) – dictionary to update.
init_key (str) – existing key
new_keyname (str) – new key to replace
init_key
- Returns:
dict – updated dictionary
- h2integrate.core.dict_utils.remove_keynames(orig_dict, init_key)#
Recursive method to remove keys from a dictionary.
- Parameters:
orig_dict (dict) – input dictionary
init_key (str) – key name to remove from dictionary
- Returns:
dict – dictionary without any keys named init_key
- h2integrate.core.dict_utils.rename_dict_keys(input_dict, init_keyname, new_keyname)#
Rename
input_dict[init_keyname]toinput_dict[new_keyname]- Parameters:
input_dict (dict) – dictionary to update
init_keyname (str) – existing key to replace
new_keyname (str) – new keyname
- Returns:
dict – updated dictionary