yfpy.models.Team
- class Team(extracted_data)[source]
Bases:
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.
- can_edit_current_week
(for Survival Football) Numeric boolean (0 or 1) representing whether the user competing in the contest can make changes in the current week.
- Type:
- champion_status
(for Tourney Pick’em) The final status of the selected champion for the contest.
- Type:
- 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:
- elimination_week
(for Survival Football) Numeric boolean (0 or 1) representing if there is an elimination week for the user competing in the contest.
- Type:
- email_address
(for Tourney Pick’em) The email address of the user competing in the contest.
- 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:
- is_in_contest
(for Survival Football) Numeric boolean (0 or 1) representing if the user is in a contest.
- Type:
- is_owned_by_current_login
Numeric boolean (0 or 1) representing if the team is owned by the current user authenticated with the Yahoo Fantasy Sports REST API.
- Type:
- last_editable_week
(for Survival Football) String boolean (“True” or “False”) representing if it is the last editable week for the user competing in the contest.
- Type:
- league_scoring_type
Value designating the type of scoring used by the league (“head” for head-to-head, etc.).
- Type:
- logo_type
(for Tourney Pick’em) The team logo type (“avatar”, etc.) of the user competing in the contest.
- Type:
- manager
(for Survival Football) A YFPY Manager instance for the user competing in the contest.
- Type:
- managers
A list or dict (depending on source data) of YFPY Manager instances.
- roster_adds
A YFPY RosterAdds instance.
- Type:
- team_logo
(for Tourney Pick’em) The direct URL to the team logo of the user competing in the contest.
- Type:
- team_paid
Numeric boolean (0 or 1) representing if the team has paid for Yahoo Fantasy Plus.
- Type:
- team_points
A YFPY TeamPoints instance.
- Type:
- team_projected_points
A YFPY TeamProjectedPoints instance.
- Type:
- team_standings
A YFPY TeamStandings instance.
- Type:
- status
(for Survival Football) The status of user competing in the contest (“dead”, etc.).
- Type:
- total_strikes
(for Survival Football) The total number of strikes (incorrect selections) made by the user competing in the contest.
- Type:
- user_display_name
(for Tourney Pick’em) The display name for the user competing in the contest.
- Type:
- user_profile_image
(for Tourney Pick’em) The direct URL to the profile image of the user competing in the contest.
- 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: