yfpy.utils.flatten_to_objects

flatten_to_objects(json_obj)[source]

Function to flatten a JSON dictionary (or a JSON dictionary in a list) to a dictionary of cast objects.

Parameters:

json_obj (Any) – JSON object (typically a dictionary or list, but can also be a primitive).

Returns:

JSON dictionary/list/primitive with contents cast to Python objects.

Return type:

dict | list | int | float | str | bool