Example #1
0
    'AEAw9%2Fuxfn6t5tJAomwsmBkwmDu7u35FSUIn%2FDEa1zernBO7QjiTwcVjZTk5ZmbsckQ6Bwe9g5htKyE%2B1VHcdGKe%2BKpnEpcO6wuZa3%2BS1k2RBjsH%2F5wwU4%2BGsMNJbCxJ%2BjrxScV0cAlcSVNBDArKkVHSy6aC5Wjdl86Sc0xJzjrw0NGmCWwCNCQlp%2FYj%2B0WZEk87BCatAaVHsc1Ojwa%2FJ5ce6CMAY2dlhxjCUX3LrY3qTxTCqOftpSjfN51aaiYX5aeYHwWBShNhTnsTI%2Bo5FOi9',
    'swid': '{9404E72D-02B1-41C9-84E7-2D02B191C9FC}'
}

league = League(league_id=79672,
                year=2022,
                espn_s2=cookies['espn_s2'],
                swid=cookies['swid'])
teams = league.teams

day = datetime.datetime.today()
#day = datetime.datetime(2021, 11, 29)
start, end = getStartEnd(day)
week = getWeekNumber(day)
current_week = league.current_week
matchups = league.scoreboard(week)
box_scores = league.box_scores()  # box_scores class
weekly_schedule = getWeeklySchedule(start, end, cookies, PRO_TEAM_MAP)
projections = {}

# Loop over teams
for team in league.teams:
    daily_points = [0] * 7
    n_games_week = []
    home = False
    current_score = getCurrentScore(team.team_name, box_scores)
    # Loop over days in week
    for i in range(day.weekday(), 7):
        player_points = []
        n_games_day = 0
        # Loop over players
Example #2
0
    def test_past_league_scoreboard(self):
        league = League(411647, 2017)
        scores = league.scoreboard()

        self.assertEqual(scores[0].home_final_score, 4211.0)
        self.assertEqual(scores[0].away_final_score, 3548.5)
Example #3
0
    def test_past_league_scoreboard(self):
        league = League(411647, 2017)
        scores = league.scoreboard()

        self.assertTrue(scores[0].home_final_score > 0)
        self.assertTrue(scores[0].away_final_score > 0)
Example #4
0
    def test_league_scoreboard(self):
        league = League(411647, 2019)
        scores = league.scoreboard()

        self.assertEqual(scores[0].home_final_score, 4240.0)
        self.assertEqual(scores[0].away_final_score, 2965.0)
Example #5
0
from espn_api.basketball import League

LEAGUE_ID = 2142217092
YEAR = 2021
ESPN_2 = "AECox3HQX41Ekc%2Bjyoa6Vj4bWoIqI3uhRpyMRAhNIDKCary6Q3Q0IFToSQahGqCar%2F%2BaJq0UlQs%2B%2BoHjndhneXswVf%2BF1zLbBbJ2AwKd%2F1hZUY1Kjv884%2FElh4e19tNeK9DqAAyr9GYWJ0Fw5Z%2FUYKWdI48gCD1rR4CjKiZgpTqgk1Tm9ifkfC0TyzDYa%2Bda4a4VvLdsS6hYMuvCJm9acLENgXYBTqvZqBeOm7UySYVCw8lqwyjacW8gnpcw6T9igzOTlDxsjW6uYhu1yvbSvTp7"
SWID = "0FA8E20F-267F-4A5E-9630-7D28BABEF81C"

league = League(league_id=2142217092, year=2021, espn_s2=ESPN_2, swid=SWID)

matchups = league.scoreboard(9)

matchup = matchups[0]

team = matchup.home_team

for i in range(len(team.roster)):
    print(team.roster[i].injuryStatus)