How to use the yfpy.models.YahooFantasyObject function in yfpy

To help you get started, we’ve selected a few yfpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uberfastman / yfpy / yfpy / models.py View on Github external
self.type = self.extracted_data.get("type", "")
        self.url = self.extracted_data.get("url", "")


class GameWeek(YahooFantasyObject):
    """Yahoo fantasy object for "game_week" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.display_name = self.extracted_data.get("display_name", "")
        self.end = self.extracted_data.get("end", "")
        self.start = self.extracted_data.get("start", "")
        self.week = self.extracted_data.get("week", "")


class PositionType(YahooFantasyObject):
    """Yahoo fantasy object for "position_type" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.type = self.extracted_data.get("type", "")
        self.display_name = self.extracted_data.get("display_name", "")


class League(YahooFantasyObject):
    """Yahoo fantasy object for "league" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.allow_add_to_dl_extra_pos = self.extracted_data.get("allow_add_to_dl_extra_pos", "")
        self.current_week = self.extracted_data.get("current_week", "")
        self.draft_results = self.extracted_data.get("draft_results", "")
github uberfastman / yfpy / yfpy / models.py View on Github external
self.waiver_priority = self.extracted_data.get("waiver_priority", "")
        self.win_probability = self.extracted_data.get("win_probability", "")


class DraftResult(YahooFantasyObject):
    """Yahoo fantasy object for "draft_result" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.pick = self.extracted_data.get("pick", "")
        self.round = self.extracted_data.get("round", "")
        self.team_key = self.extracted_data.get("team_key", "")
        self.player_key = self.extracted_data.get("player_key", "")


class Standings(YahooFantasyObject):
    """Yahoo fantasy object for "standings" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.teams = self.extracted_data.get("teams", "")


class Transaction(YahooFantasyObject):
    """Yahoo fantasy object for "transaction" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.players = self.extracted_data.get("players", "")
        self.status = self.extracted_data.get("status", "")
        self.timestamp = self.extracted_data.get("timestamp", "")
        self.tradee_team_key = self.extracted_data.get("tradee_team_key", "")
github uberfastman / yfpy / yfpy / models.py View on Github external
self.url = self.extracted_data.get("url", "")


class Name(YahooFantasyObject):
    """Yahoo fantasy object for "name" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.ascii_first = self.extracted_data.get("ascii_first", "")
        self.ascii_last = self.extracted_data.get("ascii_last", "")
        self.first = self.extracted_data.get("first", "")
        self.full = self.extracted_data.get("full", "")
        self.last = self.extracted_data.get("last", "")


class Ownership(YahooFantasyObject):
    """Yahoo fantasy object for "ownership" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.ownership_type = self.extracted_data.get("ownership_type", "")
        self.owner_team_key = self.extracted_data.get("owner_team_key", "")
        self.owner_team_name = self.extracted_data.get("owner_team_name", "")
        self.teams = self.extracted_data.get("teams", "")


class PercentOwned(YahooFantasyObject):
    """Yahoo fantasy object for "percent_owned" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.coverage_type = self.extracted_data.get("coverage_type", "")
github uberfastman / yfpy / yfpy / models.py View on Github external
self.week = self.extracted_data.get("week", "")
        self.week_end = self.extracted_data.get("week_end", "")
        self.week_start = self.extracted_data.get("week_start", "")
        self.winner_team_key = self.extracted_data.get("winner_team_key", "")


class MatchupGrade(YahooFantasyObject):
    """Yahoo fantasy object for "matchup_grade" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.grade = self.extracted_data.get("grade", "")
        self.team_key = self.extracted_data.get("team_key", "")


class Player(YahooFantasyObject):
    """Yahoo fantasy object for "player" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.bye_weeks = self.extracted_data.get("bye_weeks", ByeWeeks({}))  # type: ByeWeeks
        self.bye = self.bye_weeks.week
        self.display_position = self.extracted_data.get("display_position", "")
        self.draft_analysis = self.extracted_data.get("draft_analysis", DraftAnalysis({}))  # type: DraftAnalysis
        self.average_draft_pick = self.draft_analysis.average_pick
        self.average_draft_round = self.draft_analysis.average_round
        self.average_draft_cost = self.draft_analysis.average_cost
        self.percent_drafted = self.draft_analysis.percent_drafted
        self.editorial_player_key = self.extracted_data.get("editorial_player_key", "")
        self.editorial_team_abbr = self.extracted_data.get("editorial_team_abbr", "")
        self.editorial_team_full_name = self.extracted_data.get("editorial_team_full_name", "")
        self.editorial_team_key = self.extracted_data.get("editorial_team_key", "")
github uberfastman / yfpy / yfpy / models.py View on Github external
self.season = self.extracted_data.get("season", "")
        self.total = self.extracted_data.get("total", 0)
        self.week = self.extracted_data.get("week", "")


class TeamProjectedPoints(YahooFantasyObject):
    """Yahoo fantasy object for "team_projected_points" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.coverage_type = self.extracted_data.get("coverage_type", "")
        self.total = self.extracted_data.get("total", 0)
        self.week = self.extracted_data.get("week", "")


class TeamStandings(YahooFantasyObject):
    """Yahoo fantasy object for "team_standings" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.divisional_outcome_totals = self.extracted_data.get(
            "divisional_outcome_totals", DivisionalOutcomeTotals({}))  # type: DivisionalOutcomeTotals
        self.outcome_totals = self.extracted_data.get("outcome_totals", OutcomeTotals({}))  # type: OutcomeTotals
        self.playoff_seed = self.extracted_data.get("playoff_seed", 0)
        self.points_against = float(self.extracted_data.get("points_against", 0) or 0)
        self.points_for = float(self.extracted_data.get("points_for", 0) or 0)
        self.rank = self.extracted_data.get("rank", 0)
        self.streak = self.extracted_data.get("streak", Streak({}))  # type: Streak


class DivisionalOutcomeTotals(YahooFantasyObject):
    """Yahoo fantasy object for "divisional_outcome_totals" data key.
github uberfastman / yfpy / yfpy / models.py View on Github external
def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.coverage_type = self.extracted_data.get("coverage_type", "")
        self.is_flex = self.extracted_data.get("is_flex", "")
        self.position = self.extracted_data.get("position", "")
        self.week = self.extracted_data.get("week", "")
github uberfastman / yfpy / yfpy / models.py View on Github external
def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.type = self.extracted_data.get("type", "")
        self.value = self.extracted_data.get("value", "")


class Scoreboard(YahooFantasyObject):
    """Yahoo fantasy object for "scoreboard" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.week = self.extracted_data.get("week", "")
        self.matchups = self.extracted_data.get("matchups", [])


class Settings(YahooFantasyObject):
    """Yahoo fantasy object for "settings" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.cant_cut_list = self.extracted_data.get("cant_cut_list", "")
        self.divisions = self.extracted_data.get("divisions", "")
        self.draft_pick_time = self.extracted_data.get("draft_pick_time", "")
        self.draft_time = self.extracted_data.get("draft_time", "")
        self.draft_type = self.extracted_data.get("draft_type", "")
        self.has_multiweek_championship = self.extracted_data.get("has_multiweek_championship", "")
        self.has_playoff_consolation_games = self.extracted_data.get("has_playoff_consolation_games", "")
        self.is_auction_draft = self.extracted_data.get("is_auction_draft", "")
        self.max_teams = self.extracted_data.get("max_teams", "")
        self.num_playoff_consolation_teams = self.extracted_data.get("num_playoff_consolation_teams", "")
        self.num_playoff_teams = self.extracted_data.get("num_playoff_teams", "")
        self.pickem_enabled = self.extracted_data.get("pickem_enabled", "")
github uberfastman / yfpy / yfpy / models.py View on Github external
YahooFantasyObject.__init__(self, extracted_data)
        self.coverage_type = self.extracted_data.get("coverage_type", "")
        self.coverage_value = self.extracted_data.get("coverage_value", "")
        self.value = self.extracted_data.get("value", 0)


class TeamLogo(YahooFantasyObject):
    """Yahoo fantasy object for "team_logo" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.size = self.extracted_data.get("size", "")
        self.url = self.extracted_data.get("url", "")


class TeamPoints(YahooFantasyObject):
    """Yahoo fantasy object for "team_points" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.coverage_type = self.extracted_data.get("coverage_type", "")
        self.season = self.extracted_data.get("season", "")
        self.total = self.extracted_data.get("total", 0)
        self.week = self.extracted_data.get("week", "")


class TeamProjectedPoints(YahooFantasyObject):
    """Yahoo fantasy object for "team_projected_points" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.coverage_type = self.extracted_data.get("coverage_type", "")
github uberfastman / yfpy / yfpy / models.py View on Github external
    @classmethod
    def from_json(cls, json_data: dict):
        return cls(json_data)


class User(YahooFantasyObject):
    """Yahoo fantasy object for "user" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.games = self.extracted_data.get("games", [])
        self.guid = self.extracted_data.get("guid", "")


class Game(YahooFantasyObject):
    """Yahoo fantasy object for "game" data key.
    """
    def __init__(self, extracted_data):
        YahooFantasyObject.__init__(self, extracted_data)
        self.code = self.extracted_data.get("code", "")
        self.game_id = self.extracted_data.get("game_id", "")
        self.game_key = self.extracted_data.get("game_key", "")
        self.game_weeks = self.extracted_data.get("game_weeks", "")
        self.is_game_over = self.extracted_data.get("is_game_over", "")
        self.is_live_draft_lobby_active = self.extracted_data.get("is_live_draft_lobby_active", "")
        self.is_offseason = self.extracted_data.get("is_offseason", "")
        self.is_registration_over = self.extracted_data.get("is_registration_over", "")
        self.leagues = self.extracted_data.get("leagues", [])
        self.name = self.extracted_data.get("name", "")
        self.position_types = self.extracted_data.get("position_types", [])
        self.roster_positions = self.extracted_data.get("roster_positions", [])