yfpy.models.Stat
- class Stat(extracted_data)[source]
Bases:
YahooFantasyObject
Model class for “stat” data key.
Instantiate the Stat child class of YahooFantasyObject.
- Parameters:
extracted_data (dict) – Parsed and cleaned JSON data retrieved from the Yahoo Fantasy Sports REST API.
- enabled
Numeric boolean (0 or 1) representing if this stat is enabled for league scoring.
- Type:
- group
The stat category (“misc”, “yds_allow”, “return”, “receiving”, “rushing”, “passing”, etc.)
- Type:
- is_excluded_from_display
Numeric boolean (0 or 1) representing if this stat is not displayed.
- Type:
- is_only_display_stat
Numeric boolean (0 or 1) representing if this stat is only for display.
- Type:
- position_types
A list of YFPY PositionType instances.
- Type:
- sort_order
Numeric boolean (0 or 1) representing if the stat is sorted highest to lowest (1) or lowest to highest (0).
- Type:
- stat_position_types
A list of YFPY PositionType instances.
- 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: