actio_python_utils.utils.rename_dict_keys¶
- actio_python_utils.utils.rename_dict_keys(original_dict, renames)[source]¶
Returns a new dict that’s a copy of the supplied dict but with an arbitrary number of keys renamed
- Parameters:
original_dict (
Mapping
[Hashable
,Any
]) – The dict to rename keys inrenames (
Iterable
[tuple
[Hashable
,Hashable
]]) – A list of pairs of key names,[old, new]
- Return type:
dict
- Returns:
A dict with relabelled keys