diff --git a/nhlpy/api/schedule.py b/nhlpy/api/schedule.py index 5101b7d..b05d7fd 100644 --- a/nhlpy/api/schedule.py +++ b/nhlpy/api/schedule.py @@ -29,13 +29,16 @@ def get_schedule_by_team_by_month(self, team_abbr: str, month: Optional[str] = N resource = f"club-schedule/{team_abbr}/month/{month if month else 'now'}" return self.client.get(resource=resource).json()["games"] - def get_schedule_by_team_by_week(self, team_abbr: str) -> List[dict]: + def get_schedule_by_team_by_week(self, team_abbr: str, date: Optional[str] = None) -> List[dict]: """ - This returns the schedule for the team (team_abbr) for the current week. + This returns the schedule for the team (team_abbr) for the week set or the current week if no week is specified. + + :param date: Optional date, in which to search the week of. In format YYYY-MM-DD. Example "2024-02-10". + :param team_abbr: The 3 letter abbreviation of the team. BUF, TOR, etc :return: """ - resource = f"club-schedule/{team_abbr}/week/now" + resource = f"club-schedule/{team_abbr}/week/{date if date else 'now'}" return self.client.get(resource=resource).json()["games"] def get_season_schedule(self, team_abbr: str, season: str) -> dict: