yfpy.models.Team
- class Team(extracted_data)[source]
Bases:
yfpy.models.YahooFantasyObject
Model class for “team” data key.
Instantiate the Team child class of YahooFantasyObject.
- Parameters
extracted_data (dict) – Parsed and cleaned JSON data retrieved from the Yahoo Fantasy Sports REST API.
- clinched_playoffs
Numeric boolean (0 or 1) representing if the team has clinched a playoff berth.
- Type
- draft_grade
The letter grade assigned to the draft completed by the team (“A+”, “A”, …, “F-“).
- Type
- draft_results
A list of YFPY DraftResult instances.
- Type
- faab_balance
The available balance of FAAB (Free Agent Acquisition Budget) (if applicable).
- Type
- has_draft_grade
Numeric boolean (0 or 1) representing if the team has a draft grade available.
- Type
- league_scoring_type
Value designating the type of scoring used by the league (“head” for head-to-head, etc.).
- Type
- managers
A list or dict (depending on source data) of YFPY Manager instances.
- roster_adds
A YFPY RosterAdds instance.
- Type
- team_points
A YFPY TeamPoints instance.
- Type
- team_projected_points
A YFPY TeamProjectedPoints instance.
- Type
- team_standings
A YFPY TeamStandings instance.
- Type
- win_probability
The active win probability of the team in its current matchup (ranges from 0.0 to 1.0).
- 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