2022-06-06 02:58:53 +02:00
|
|
|
""" Ergast class """
|
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
from __future__ import annotations
|
2022-06-05 20:46:37 +02:00
|
|
|
|
2022-06-05 19:12:11 +02:00
|
|
|
from typing import Callable
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 20:46:37 +02:00
|
|
|
from ergast_py.constants.status_type import StatusType
|
2022-06-01 15:31:52 +02:00
|
|
|
from ergast_py.models.circuit import Circuit
|
|
|
|
from ergast_py.models.constructor import Constructor
|
2022-06-05 20:46:37 +02:00
|
|
|
from ergast_py.models.driver import Driver
|
|
|
|
from ergast_py.models.race import Race
|
|
|
|
from ergast_py.models.season import Season
|
2022-06-01 15:31:52 +02:00
|
|
|
from ergast_py.models.standings_list import StandingsList
|
|
|
|
from ergast_py.models.status import Status
|
|
|
|
from ergast_py.requester import Requester
|
|
|
|
from ergast_py.type_constructor import TypeConstructor
|
|
|
|
|
2022-06-05 20:46:37 +02:00
|
|
|
|
2022-06-06 02:58:53 +02:00
|
|
|
#pylint: disable=too-many-public-methods
|
2022-06-01 15:31:52 +02:00
|
|
|
class Ergast():
|
|
|
|
"""
|
2022-06-06 02:58:53 +02:00
|
|
|
Ergast
|
|
|
|
~~~~~~
|
|
|
|
Class for querying the Ergast API.
|
|
|
|
|
|
|
|
Build up the queries using the available functions.
|
|
|
|
|
|
|
|
>>> e = ergast_py.Ergast()
|
2022-07-06 23:09:52 +02:00
|
|
|
>>> e.season(2021).round(1).driver("alonso")
|
2022-06-06 02:58:53 +02:00
|
|
|
|
|
|
|
Get the data using ``.get_xyz()`` functions.
|
|
|
|
|
|
|
|
>>> print(e.get_result())
|
2022-06-01 15:31:52 +02:00
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self) -> None:
|
|
|
|
self.reset()
|
|
|
|
self.requester = Requester()
|
|
|
|
self.type_constructor = TypeConstructor()
|
|
|
|
|
|
|
|
|
|
|
|
def reset(self) -> None:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Reset the Ergast query building.
|
|
|
|
|
|
|
|
Should be called after a query is run to prevent forward interraction.
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params = {
|
|
|
|
"season": None,
|
|
|
|
"seasons": None,
|
|
|
|
"round": None,
|
|
|
|
"driver": None,
|
|
|
|
"constructor": None,
|
|
|
|
"grid": None,
|
|
|
|
"qualifying": None,
|
|
|
|
"sprint": None,
|
|
|
|
"result": None,
|
|
|
|
"fastest": None,
|
|
|
|
"circuit": None,
|
|
|
|
"status": None,
|
|
|
|
"standing": None,
|
|
|
|
"races": None,
|
|
|
|
"limit": None,
|
|
|
|
"offset": None,
|
|
|
|
"lap": None,
|
|
|
|
"pit_stop": None,
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# FILTER FUNCTIONS
|
|
|
|
#
|
|
|
|
|
|
|
|
def season(self, year: int="current") -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a season to the current query
|
|
|
|
|
|
|
|
>>> e.season(2022).get_races()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["season"] = year
|
|
|
|
return self
|
|
|
|
|
2022-06-05 19:12:11 +02:00
|
|
|
def round(self, round_no: int="last") -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a round to the current query
|
|
|
|
|
|
|
|
>>> e.season(1999).round(3).get_circuit()
|
|
|
|
"""
|
2022-06-05 19:12:11 +02:00
|
|
|
self.params["round"] = round_no
|
2022-06-01 15:31:52 +02:00
|
|
|
return self
|
|
|
|
|
2022-07-06 23:09:52 +02:00
|
|
|
def driver(self, driver) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a driver to the current query
|
|
|
|
|
2022-07-06 23:09:52 +02:00
|
|
|
>>> alonso = e.driver("alonso").get_driver()
|
2022-06-06 02:58:53 +02:00
|
|
|
>>> e.driver(alonso).get_results()
|
|
|
|
"""
|
2022-07-06 23:09:52 +02:00
|
|
|
if isinstance(driver, str):
|
|
|
|
self.params["driver"] = driver
|
|
|
|
elif isinstance(driver, Driver):
|
|
|
|
self.params["driver"] = driver.driverId
|
|
|
|
else:
|
|
|
|
raise TypeError("Function parameter must be of type Driver or str")
|
2022-06-01 15:31:52 +02:00
|
|
|
return self
|
|
|
|
|
|
|
|
def constructor(self, constructor: Constructor) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a constructor to the current query
|
|
|
|
|
2022-07-06 23:09:52 +02:00
|
|
|
>>> mercedes = e.constructor("mercedes").get_constructor()
|
2022-06-06 02:58:53 +02:00
|
|
|
>>> e.constructor(mercedes).get_constructor_standings()
|
|
|
|
"""
|
2022-07-06 23:09:52 +02:00
|
|
|
if isinstance(constructor, str):
|
|
|
|
self.params["constructor"] = constructor
|
|
|
|
elif isinstance(constructor, Constructor):
|
|
|
|
self.params["constructor"] = constructor.constructorId
|
|
|
|
else:
|
|
|
|
raise TypeError("Function parameter must be of type Constructor or str")
|
2022-06-01 15:31:52 +02:00
|
|
|
return self
|
|
|
|
|
|
|
|
def qualifying(self, position: int) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a qualifying position to the current query
|
|
|
|
|
|
|
|
>>> e.season(2021).qualifying(1).get_drivers()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["qualifying"] = position
|
|
|
|
return self
|
|
|
|
|
|
|
|
def sprint(self, position: int) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a sprint result to the current query
|
|
|
|
|
|
|
|
>>> e.season(2021).sprint(3).get_sprints()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["sprint"] = position
|
|
|
|
return self
|
|
|
|
|
|
|
|
def grid(self, position: int) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a starting grid position to the current query
|
|
|
|
|
|
|
|
>>> e.season(2021).round(1).grid(1).get_result()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["grid"] = position
|
|
|
|
return self
|
|
|
|
|
|
|
|
def result(self, position: int) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a final result to the current query
|
|
|
|
|
|
|
|
>>> e.season(2021).round(1).result(20).get_result()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["result"] = position
|
|
|
|
return self
|
|
|
|
|
|
|
|
def fastest(self, position: int) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a driver's fastest lap ranking to the current query
|
|
|
|
|
|
|
|
>>> e.season(2021).round(1).fastest(1).get_driver()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["fastest"] = position
|
|
|
|
return self
|
|
|
|
|
2022-07-06 23:09:52 +02:00
|
|
|
def circuit(self, circuit) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a circuit to the current query
|
|
|
|
|
2022-07-06 23:09:52 +02:00
|
|
|
>>> silverstone = e.circuit("silverstone").get_circuit()
|
2022-06-06 02:58:53 +02:00
|
|
|
>>> e.circuit(silverstone)
|
|
|
|
"""
|
2022-07-06 23:09:52 +02:00
|
|
|
if isinstance(circuit, str):
|
|
|
|
self.params["circuit"] = circuit
|
|
|
|
elif isinstance(circuit, Circuit):
|
|
|
|
self.params["circuit"] = circuit.circuitId
|
|
|
|
else:
|
|
|
|
raise TypeError("Function parameter must be of type Circuit or str")
|
2022-06-01 15:31:52 +02:00
|
|
|
return self
|
|
|
|
|
2022-07-06 23:09:52 +02:00
|
|
|
def status(self, status) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a finishing status to the current query
|
|
|
|
|
2022-07-06 23:09:52 +02:00
|
|
|
>>> e.driver("alonso").status(2)
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
2022-07-06 23:09:52 +02:00
|
|
|
if isinstance(status, str):
|
|
|
|
self.params["status"] = status
|
|
|
|
elif isinstance(status, int):
|
|
|
|
self.params["status"] = StatusType().string_to_id[status]
|
|
|
|
else:
|
|
|
|
raise TypeError("Function parameter must be of type int or str")
|
2022-06-01 15:31:52 +02:00
|
|
|
return self
|
|
|
|
|
|
|
|
def standing(self, position: int) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a position in the standings to the current query
|
|
|
|
|
|
|
|
>>> e.standing(1).get_driver_standings()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["standing"] = position
|
|
|
|
return self
|
|
|
|
|
|
|
|
def lap(self, lap_number: int) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a certain lap to the current query
|
|
|
|
|
|
|
|
>>> e.season(2021).round(1).lap(1).get_laps()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["lap"] = lap_number
|
|
|
|
return self
|
|
|
|
|
|
|
|
def pit_stop(self, stop_number: int) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Add a certain pit stop to the current query
|
|
|
|
|
|
|
|
>>> e.season(2021).round(1).pit_stop(1).get_pit_stops()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["pit_stop"] = stop_number
|
|
|
|
return self
|
|
|
|
|
|
|
|
#
|
|
|
|
# PAGING FUNCTIONS
|
|
|
|
#
|
|
|
|
|
|
|
|
def limit(self, amount: int) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Limit the results in the current query
|
|
|
|
|
|
|
|
>>> e.season(2021).limit(2).get_drivers()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["limit"] = amount
|
|
|
|
return self
|
|
|
|
|
|
|
|
def offset(self, amount: int) -> Ergast:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Offset the results in the current query
|
|
|
|
|
|
|
|
>>> e.season(2021).limit(2).offset(4).get_drivers()
|
|
|
|
"""
|
2022-06-01 15:31:52 +02:00
|
|
|
self.params["offset"] = amount
|
|
|
|
return self
|
|
|
|
|
|
|
|
#
|
|
|
|
# RETURN FUNCTIONS
|
|
|
|
#
|
|
|
|
|
2022-06-05 19:12:11 +02:00
|
|
|
# Lambda queries
|
|
|
|
|
|
|
|
def _get_items(self, get_items: Callable, construct_items: Callable):
|
|
|
|
items_json = get_items(self.params)
|
|
|
|
items = construct_items(items_json)
|
|
|
|
self.reset()
|
|
|
|
return items
|
|
|
|
|
|
|
|
def _get_item(self, get_items: Callable, construct_items: Callable):
|
|
|
|
items = self._get_items(get_items, construct_items)
|
|
|
|
if len(items) == 1:
|
|
|
|
return items[0]
|
|
|
|
raise Warning("More than 1 element found")
|
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
# Race and Results Queries
|
|
|
|
|
|
|
|
def get_circuits(self) -> list[Circuit]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of circuits from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_circuits,
|
|
|
|
self.type_constructor.construct_circuits)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_circuit(self) -> Circuit:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a circuit from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_circuits,
|
|
|
|
self.type_constructor.construct_circuits)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
def get_constructors(self) -> list[Constructor]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of constructors from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_constructors,
|
|
|
|
self.type_constructor.construct_constructors)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_constructor(self) -> Constructor:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a constructor from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_constructors,
|
|
|
|
self.type_constructor.construct_constructors)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
def get_drivers(self) -> list[Driver]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of drivers from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_drivers,
|
|
|
|
self.type_constructor.construct_drivers)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_driver(self) -> Driver:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a driver from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_drivers,
|
|
|
|
self.type_constructor.construct_drivers)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
|
|
|
def get_qualifyings(self) -> list[Race]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of qualifyings from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_qualifying,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_qualifying(self) -> Race:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a qualifying from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_qualifying,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
def get_sprints(self) -> list[Race]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of sprints from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_sprints,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_sprint(self) -> Race:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a sprint from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_sprints,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
def get_results(self) -> list[Race]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of results from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_results,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_result(self) -> Race:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a result from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_results,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
def get_races(self) -> list[Race]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of races from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_races,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_race(self) -> Race:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a race from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_races,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
def get_seasons(self) -> list[Season]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of seasons from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_seasons,
|
|
|
|
self.type_constructor.construct_seasons)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_season(self) -> Season:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a season from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_seasons,
|
|
|
|
self.type_constructor.construct_seasons)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
def get_statuses(self) -> list[Status]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of statuses from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_statuses,
|
|
|
|
self.type_constructor.construct_statuses)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_status(self) -> Status:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a status from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_statuses,
|
|
|
|
self.type_constructor.construct_statuses)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
# Standings Queries
|
|
|
|
|
|
|
|
def get_driver_standings(self) -> list[StandingsList]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of driver standings from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_driver_standings,
|
|
|
|
self.type_constructor.construct_driver_standings)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_driver_standing(self) -> StandingsList:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a driver standing from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_driver_standings,
|
|
|
|
self.type_constructor.construct_driver_standings)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
def get_constructor_standings(self) -> list[StandingsList]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of constructor standings from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_constructor_standings,
|
|
|
|
self.type_constructor.construct_constructor_standings)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_constructor_standing(self) -> StandingsList:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a constructor standing from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_constructor_standings,
|
|
|
|
self.type_constructor.construct_constructor_standings)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
# Laps and Pit Stops Queries
|
|
|
|
|
|
|
|
def get_laps(self) -> list[Race]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of laps from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_laps,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-01 15:31:52 +02:00
|
|
|
|
2022-06-05 14:23:16 +02:00
|
|
|
def get_lap(self) -> Race:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a lap from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_laps,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
2022-06-01 15:31:52 +02:00
|
|
|
def get_pit_stops(self) -> list[Race]:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a list of pit stops from the current query
|
|
|
|
"""
|
|
|
|
return self._get_items(self.requester.get_pit_stops,
|
|
|
|
self.type_constructor.construct_races)
|
2022-06-05 14:23:16 +02:00
|
|
|
|
|
|
|
def get_pit_stop(self) -> Race:
|
2022-06-06 02:58:53 +02:00
|
|
|
"""
|
|
|
|
Get a pit stop from the current query
|
|
|
|
"""
|
|
|
|
return self._get_item(self.requester.get_pit_stops,
|
|
|
|
self.type_constructor.construct_races)
|