yfpy.utils.flatten_json_dict_list

flatten_json_dict_list(json_obj_dict_list, parent_class)[source]

Recursive function to flatten JSON lists containing all disparate JSON dictionaries with no overlapping keys.

Parameters
  • json_obj_dict_list (list[dict[str, Any]]) – List of JSON dictionaries.

  • parent_class (Type) – Parent class type used to extract custom subclass type options.

Returns

Returns a dictionary if the list was flattened, else a cleaned list if no flattening was needed.

Return type

dict | list