yfpy.utils

YFPY module for managing complex JSON data structures.

logger

Module level logger for usage and debugging.

Type

Logger

Functions

complex_json_handler

Custom handler to allow custom YFPY objects to be serialized into JSON.

convert_strings_to_numeric_equivalents

Convert JSON strings with integer or float numeric representations to their respective integer or float values.

dict_to_list

Function to convert a JSON dictionary to a list.

flatten_json_dict_list

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

flatten_to_list

Function to flatten JSON dictionaries with unnecessary keys to a list of objects.

flatten_to_objects

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

get_type

Cast JSON object to custom subclass type extracted from parent class.

prettify_data

Function to return pretty formatted JSON strings for easily readable output from objects.

reformat_json_list

Function to clean and reformat JSON lists to eliminate empty values and unnecessarily nested lists.

reorganize_json_dict

Function to reorganize a JSON dictionary of dictionaries.

unpack_data

Recursive function to parse, clean, and assign custom data types to retrieved Yahoo Fantasy Sports data.