Skip to content

Dict Helpers

Utility Functions and Classes for manipulating dictionaries.

NameDescription
dict_helpers.flatten_dictFlatten nested keys into a single string key per leaf.
dict_helpers.flatten_dict_no_prefixFlatten using only the leaf key name at each branch (no hierarchical prefix).
dict_helpers.flattened_key_iteratorIterator over flattened string keys.
dict_helpers.flattened_value_iteratorIterator over leaf values in depth-first order.
dict_helpers.kfilter_dictFilter a nested dict by key predicate.
dict_helpers.map_dictMap a function over every leaf value while preserving nesting.
dict_helpers.unflatten_dictInverse of flatten_dict for a given template shape.
DIteratorFluent wrapper for iterating and transforming nested dictionaries.