From 3b1cf3c8e45d22ba305b377be3c37d259608adfe Mon Sep 17 00:00:00 2001 From: Christian Wendt Date: Fri, 8 Nov 2024 15:33:30 +0000 Subject: [PATCH] Football Team Season Stats --- espn_api/football/team.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/espn_api/football/team.py b/espn_api/football/team.py index c129012d..faee715d 100644 --- a/espn_api/football/team.py +++ b/espn_api/football/team.py @@ -1,4 +1,5 @@ from .player import Player +from .constant import PLAYER_STATS_MAP class Team(object): '''Teams are part of the league''' @@ -38,6 +39,7 @@ def __init__(self, data, roster, schedule, year, **kwargs): self._fetch_schedule(schedule) self._fetch_roster(roster, year, kwargs.get('pro_schedule')) self.owners = kwargs.get('owners', []) + self.stats = {PLAYER_STATS_MAP.get(int(i), i): j for i, j in data.get('valuesByStat', {}).items()} def __repr__(self): return 'Team(%s)' % (self.team_name, )