How to use the yfpy.models.TeamStandings 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.name = self.extracted_data.get("name", "").encode("utf-8")
        self.number_of_moves = self.extracted_data.get("number_of_moves", "")
        self.number_of_trades = self.extracted_data.get("number_of_trades", "")
        self.roster = self.extracted_data.get("roster", Roster({}))  # type: Roster
        self.players = self.roster.players
        self.roster_adds = self.extracted_data.get("roster_adds", RosterAdds({}))  # type: RosterAdds
        self.roster_adds_value = self.roster_adds.value
        self.team_id = self.extracted_data.get("team_id", "")
        self.team_key = self.extracted_data.get("team_key", "")
        self.team_logos = self.extracted_data.get("team_logos", "")
        self.team_points = self.extracted_data.get("team_points", TeamPoints({}))  # type: TeamPoints
        self.points = float(self.team_points.total)
        self.team_projected_points = self.extracted_data.get("team_projected_points",
                                                             TeamProjectedPoints({}))  # type: TeamProjectedPoints
        self.projected_points = float(self.team_projected_points.total)
        self.team_standings = self.extracted_data.get("team_standings", TeamStandings({}))  # type: TeamStandings
        self.wins = int(self.team_standings.outcome_totals.wins)
        self.losses = int(self.team_standings.outcome_totals.losses)
        self.ties = int(self.team_standings.outcome_totals.ties)
        self.percentage = float(self.team_standings.outcome_totals.percentage)
        self.playoff_seed = self.team_standings.playoff_seed
        self.points_against = self.team_standings.points_against
        self.points_for = self.team_standings.points_for
        self.rank = self.team_standings.rank
        self.streak_type = self.team_standings.streak.type
        self.streak_length = self.team_standings.streak.value
        self.url = self.extracted_data.get("url", "")
        self.waiver_priority = self.extracted_data.get("waiver_priority", "")
        self.win_probability = self.extracted_data.get("win_probability", "")
github uberfastman / yfpy / yfpy / query.py View on Github external
"percentage": 0.643,
                    "ties": 0,
                    "wins": 9
                  },
                  "streak": {
                    "type": "win",
                    "value": "1"
                  },
                  "points_for": "1409.24",
                  "points_against": 1266.6599999999999
                }
        """
        team_key = self.get_league_key() + ".t." + str(team_id)
        return self.query(
            "https://fantasysports.yahooapis.com/fantasy/v2/team/" + str(team_key) + "/standings",
            ["team", "team_standings"], TeamStandings)