yfpy.models.Game
- class Game(extracted_data)[source]
Bases:
yfpy.models.YahooFantasyObject
Model class for “game” data key.
Instantiate the Game child class of YahooFantasyObject.
- Parameters
extracted_data (dict) – Parsed and cleaned JSON data retrieved from the Yahoo Fantasy Sports REST API.
- is_live_draft_lobby_active
Numeric boolean (0 or 1) representing if the draft lobby is active.
- Type
- is_offseason
Numeric boolean (0 or 1) representing if it is the offseason for the respective sport.
- Type
- is_registration_over
Numeric boolean (0 or 1) representing registration for the fantasy game is over.
- Type
- position_types
A list of YFPY PositionType instances.
- Type
- roster_positions
A list of YFPY RosterPosition instances.
- Type
- stat_categories
A YFPY StatCategories instance.
- Type
Methods
Recursive method to un-type custom class type objects for serialization.
Deserialize JSON to a class object.
Pack up all object content into nested dictionaries for JSON serialization.
Derive snake case dictionary keys from custom object type camel case class names.
Serialize the class object to JSON.
- clean_data_dict()
Recursive method to un-type custom class type objects for serialization.
- Returns
Dictionary that extracts serializable data from custom objects.
- Return type
- classmethod from_json(json_data)
Deserialize JSON to a class object.
- Returns
Class object derived from JSON data.
- Return type
- serialized()
Pack up all object content into nested dictionaries for JSON serialization.
- Returns
Serializable dictionary.
- Return type
- subclass_dict()
Derive snake case dictionary keys from custom object type camel case class names.
- Returns
Dictionary with snake case strings of all subclasses of YahooFantasyObject as keys and subclasses as values.
- Return type