yfpy.models.League
- class League(extracted_data)[source]
Bases:
yfpy.models.YahooFantasyObject
Model class for “league” data key.
Instantiate the League child class of YahooFantasyObject.
- Parameters
extracted_data (dict) – Parsed and cleaned JSON data retrieved from the Yahoo Fantasy Sports REST API.
- allow_add_to_dl_extra_pos
Numeric boolean (0 or 1) representing if the leagues allows adding extra positions to the DL (currently uncertain what this is).
- Type
- draft_results
A list of YFPY DraftResult instances.
- Type
- is_cash_league
Numeric boolean (0 or 1) representing if the league is a Yahoo paid league.
- Type
- payment_deadline
A date string representing the deadline by which all league dues payments must be made (format: “YYYY-MM-DD”).
- Type
- renew
A string indicating the previous Yahoo game code and previous Yahoo league ID (Ex.: “371_811308”) (if applicable).
- Type
str | null
- renewed
A string indicating the next Yahoo game code and next Yahoo league ID (Ex.: “390_303233”) (if applicable).
- Type
str | null
- scoreboard
A YFPY Scoreboard instance.
- Type
- short_invitation_url
The sharable short URL sent by invite allowing players to join the league.
- Type
- teams_ordered_by_standings
A list of YFPY Team instances ordered by their ranks in the league standings.
- start_date
A date string representing the start date of the league (format: “YYYY-MM-DD”).
- Type
- transactions
A list of YFPY Transaction 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