create_parent_key#
- eoio.utils.dict_tools.create_parent_key(input_dict: dict, delim='_', to_ignore: list | str | None = None, to_add: list | str | None = None) None[source]#
Combine keys with common text under a new parent key in dictionary
- Parameters:
input_dict – dictionary to modify
delim – delimiter to use when splitting the keys, defaults to _
to_ignore – list or str of any text values to ignore as first values
to_add – list or str of any text to add to first values (things you want as a key, starting from first level with no shared keys)