yfpy.models.Player
- class Player(extracted_data)[source]
Bases:
YahooFantasyObject
Model class for “player” data key.
Instantiate the Player child class of YahooFantasyObject.
- Parameters:
extracted_data (dict) – Parsed and cleaned JSON data retrieved from the Yahoo Fantasy Sports REST API.
- draft_analysis
A YFPY DraftAnalysis instance.
- Type:
- editorial_team_abbr
The abbreviation of the professional team name for which the player plays.
- Type:
- editorial_team_key
The Yahoo team key of the professional team for which the player plays using the game key.
- Type:
- editorial_team_url
The direct URL of the professional team for which the player plays on Yahoo Sports.
- Type:
- has_recent_player_notes
Numeric boolean (0 or 1) representing if the player has any recent notes.
- Type:
- percent_owned
A YFPY PercentOwned instanced.
- Type:
- percent_owned_value
The percentage value the player is/was owned in the coverage timeframe.
- Type:
- player_points
A YFPY PlayerPoints instance.
- Type:
- player_stats
A YFPY PlayerStats instance.
- Type:
- selected_position
A YFPY SelectedPosition instance.
- Type:
- transaction_data
A YFPY TransactionData 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: