Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions src/iracingdataapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,22 +544,6 @@ def league_season_sessions(
}
return self._get_resource("/data/league/season_sessions", payload=payload)

def lookup_club_history(self, season_year: int, season_quarter: int) -> list[Dict]:
"""The club history for a year and season.

Note: returns an earlier history if requested quarter does not have a club history

Args:
season_year (int): the season year
season_quarter (int): the season quarter (1, 2, 3, 4)

Returns:
list: a list containing all the history from all clubs in the requested year and season.

"""
payload = {"season_year": season_year, "season_quarter": season_quarter}
return self._get_resource("/data/lookup/club_history", payload=payload)

def lookup_countries(self) -> list[Dict]:
"""The list of country names and the country codes.

Expand Down Expand Up @@ -1055,7 +1039,6 @@ def stats_season_driver_standings(
season_id: int,
car_class_id: int,
race_week_num: Optional[int] = None,
club_id: Optional[int] = None,
division: Optional[int] = None,
) -> Dict:
"""Get the driver standings from a season.
Expand All @@ -1064,7 +1047,6 @@ def stats_season_driver_standings(
season_id (int): The iRacing season id.
car_class_id (int): the iRacing car class id.
race_week_num (int): the race week number (0-12). Default 0.
club_id (int): the iRacing club id. Defaults to all (-1).
division (int): the iRacing division. Divisions are 0-based: 0 is Division 1, 10 is Rookie.
See /data/constants/divisons for more information. Defaults to all.

Expand All @@ -1075,8 +1057,6 @@ def stats_season_driver_standings(
payload = {"season_id": season_id, "car_class_id": car_class_id}
if race_week_num is not None:
payload["race_week_num"] = race_week_num
if club_id:
payload["club_id"] = club_id
if division is not None:
payload["division"] = division

Expand All @@ -1090,7 +1070,6 @@ def stats_season_supersession_standings(
season_id: int,
car_class_id: int,
race_week_num: Optional[int] = None,
club_id: Optional[int] = None,
division: Optional[int] = None,
) -> Dict:
"""Get the supersession standings from a season.
Expand All @@ -1099,7 +1078,6 @@ def stats_season_supersession_standings(
season_id (int): The iRacing season id.
car_class_id (int): the iRacing car class id.
race_week_num (int): the race week number (0-12). Default 0.
club_id (int): the iRacing club id. Defaults to all (-1).
division (int): the iRacing division. Divisions are 0-based: 0 is Division 1, 10 is Rookie.
See /data/constants/divisons for more information. Defaults to all.

Expand All @@ -1110,8 +1088,6 @@ def stats_season_supersession_standings(
payload = {"season_id": season_id, "car_class_id": car_class_id}
if race_week_num is not None:
payload["race_week_num"] = race_week_num
if club_id:
payload["club_id"] = club_id
if division is not None:
payload["division"] = division

Expand Down Expand Up @@ -1148,7 +1124,6 @@ def stats_season_tt_standings(
season_id: int,
car_class_id: int,
race_week_num: Optional[int] = None,
club_id: Optional[int] = None,
division: Optional[int] = None,
) -> Dict:
"""Get the Time Trial standings from a season.
Expand All @@ -1157,7 +1132,6 @@ def stats_season_tt_standings(
season_id (int): The iRacing season id.
car_class_id (int): the iRacing car class id.
race_week_num (int): the race week number (0-12).
club_id (int): the iRacing club id.
division (int): the iRacing division.

Returns:
Expand All @@ -1167,8 +1141,6 @@ def stats_season_tt_standings(
payload = {"season_id": season_id, "car_class_id": car_class_id}
if race_week_num is not None:
payload["race_week_num"] = race_week_num
if club_id:
payload["club_id"] = club_id
if division is not None:
payload["division"] = division

Expand All @@ -1182,7 +1154,6 @@ def stats_season_tt_results(
season_id: int,
car_class_id: int,
race_week_num: int,
club_id: Optional[int] = None,
division: Optional[int] = None,
) -> Dict:
"""Get the Time Trial results from a season.
Expand All @@ -1191,7 +1162,6 @@ def stats_season_tt_results(
season_id (int): The iRacing season id.
car_class_id (int): the iRacing car class id.
race_week_num (int): the race week number (0-12).
club_id (int): the iRacing club id.
division (int): the iRacing division.

Returns:
Expand All @@ -1203,8 +1173,6 @@ def stats_season_tt_results(
"car_class_id": car_class_id,
"race_week_num": race_week_num,
}
if club_id:
payload["club_id"] = club_id
if division is not None:
payload["division"] = division

Expand All @@ -1216,7 +1184,6 @@ def stats_season_qualify_results(
season_id: int,
car_class_id: int,
race_week_num: int,
club_id: Optional[int] = None,
division: Optional[int] = None,
) -> Dict:
"""Get the qualifying results from a season.
Expand All @@ -1225,7 +1192,6 @@ def stats_season_qualify_results(
season_id (int): The iRacing season id.
car_class_id (int): the iRacing car class id.
race_week_num (int): the race week number (0-12).
club_id (int): the iRacing club id.
division (int): the iRacing division.

Returns:
Expand All @@ -1237,8 +1203,6 @@ def stats_season_qualify_results(
"car_class_id": car_class_id,
"race_week_num": race_week_num,
}
if club_id:
payload["club_id"] = club_id
if division is not None:
payload["division"] = division

Expand Down
17 changes: 0 additions & 17 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,23 +1026,6 @@ def test_league_season_sessions(self, mock_get_resource):
)
self.assertEqual(result, mock_get_resource.return_value)

@patch.object(irDataClient, "_get_resource")
def test_lookup_club_history(self, mock_get_resource):
mock_get_resource.return_value = [{"history": "club_history_data"}]
season_year = 2021
season_quarter = 3
expected_payload = {
"season_year": season_year,
"season_quarter": season_quarter,
}

result = self.client.lookup_club_history(season_year, season_quarter)

mock_get_resource.assert_called_once_with(
"/data/lookup/club_history", payload=expected_payload
)
self.assertEqual(result, mock_get_resource.return_value)

@patch.object(irDataClient, "_get_resource")
def test_lookup_drivers(self, mock_get_resource):
mock_get_resource.return_value = [{"driver": "driver_data"}]
Expand Down