yfpy.models.Settings

class Settings(extracted_data)[source]

Bases: YahooFantasyObject

Model class for “settings” data key.

Instantiate the Settings child class of YahooFantasyObject.

Parameters:

extracted_data (dict) – Parsed and cleaned JSON data retrieved from the Yahoo Fantasy Sports REST API.

cant_cut_list

Numeric boolean (0 or 1) representing if the league uses the Yahoo “can’t cut list”.

Type:

int

divisions

A list of YFPY Division instances for leagues with divisions.

Type:

list[Division]

draft_pick_time

The number of seconds allowed to make each draft pick.

Type:

int

draft_time

A timestamp representing when the draft will start.

Type:

int

draft_together

Numeric boolean (0 or 1) representing if the league uses Yahoo Fantasy Draft Together live video chat during online drafts.

Type:

int

draft_type

The type of draft (“live”, “offline”, etc.)

Type:

str

has_multiweek_championship

Numeric boolean (0 or 1) representing if the league has a multi-week championship matchup.

Type:

int

has_playoff_consolation_games

Numeric boolean (0 or 1) representing if the league has a consolation playoff bracket.

Type:

bool

is_auction_draft

Numeric boolean (0 or 1) representing if the league uses an auction draft.

Type:

int

max_teams

The maximum number of teams allowed in the league.

Type:

int

num_playoff_consolation_teams

The number of teams that make the consolation playoff bracket.

Type:

int

num_playoff_teams

The number of teams that make the playoffs.

Type:

int

pickem_enabled

Numeric boolean (0 or 1) representing if the league has enabled the built-in Yahoo “pick ‘em” game that allows managers to pick winners of each fantasy matchup each week in the league.

Type:

int

player_pool

Value designating what player pool is allowed for the league (“ALL”, etc.).

Type:

str

playoff_start_week

The week number on which the playoffs start.

Type:

int

post_draft_players

Value designating what happens to players after the draft (“W” for waivers, etc.).

Type:

str

roster_positions

A list of YFPY RosterPosition instances.

Type:

list[RosterPosition]

scoring_type

Value designating what type of scoring the league uses (“head” for head-to-head, etc.).

Type:

str

sendbird_channel_url

The in-app Sendbird channel ID.

Type:

str

stat_categories

A YFPY StatCategories instance.

Type:

StatCategories

stat_modifiers

A YFPY StatModifiers instance.

Type:

StatModifiers

trade_end_date

A date string representing when trading is no longer allowed (format: “YYYY-MM-DD”).

Type:

str

trade_ratify_type

Value designating how trades are ratified (“commish” for commissioner, etc.).

Type:

str

trade_reject_time

The number of days during which a trade can be rejected.

Type:

int

uses_faab

Numeric boolean (0 or 1) representing if the league uses FAAB (Free Agent Acquisition Budget).

Type:

int

uses_fractional_points

Numeric boolean (0 or 1) representing if the league allows fractional scoring.

Type:

int

uses_lock_eliminated_teams

Numeric boolean (0 or 1) representing if the league locks teams eliminated from the playoffs.

Type:

int

uses_median_score

(for paid subscribers to Yahoo Fantasy Commissioner Plus) Numeric boolean (0 or 1) representing if the league plays an extra game against the median each week.

Type:

int

uses_negative_points

Numeric boolean (0 or 1) representing if the league allows negative scoring.

Type:

int

uses_playoffs

Numeric boolean (0 or 1) representing if the league has playoffs.

Type:

int

uses_playoff_reseeding

Numeric boolean (0 or 1) representing if the league reseeds the playoffs once the fantasy regular season is complete.

Type:

int

waiver_rule

Value designating when players go to waivers (“gametime”, etc.).

Type:

str

waiver_time

The number of days that players remain on waivers.

Type:

int

waiver_type

Value designating what type of waivers are used by the league (“R” for rolling, etc.).

Type:

str

Methods

clean_data_dict

Recursive method to un-type custom class type objects for serialization.

from_json

Deserialize JSON to a class object.

serialized

Pack up all object content into nested dictionaries for JSON serialization.

subclass_dict

Derive snake case dictionary keys from custom object type camel case class names.

to_json

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:

dict

classmethod from_json(json_data)

Deserialize JSON to a class object.

Returns:

Class object derived from JSON data.

Return type:

object

serialized()

Pack up all object content into nested dictionaries for JSON serialization.

Returns:

Serializable dictionary.

Return type:

dict

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:

dict

to_json()

Serialize the class object to JSON.

Returns:

JSON string derived from the serializable version of the class object.

Return type:

str