dataeval.utils.metadata.flatten

dataeval.utils.metadata.flatten(d, sep, ignore_lists, fully_qualified)

Flattens a dictionary and converts values to numeric values when possible.

Parameters:
d : dict[str, Any]

Dictionary to flatten

sep : str

String separator to use when concatenating key names

ignore_lists : bool

Option to skip expanding lists within metadata

fully_qualified : bool

Option to return dictionary keys full qualified instead of reduced

Returns:

A tuple of the flattened dictionary and the length of detected lists in metadata

Return type:

tuple[dict[str, Any], int]