This repository has been archived on 2022-08-24. You can view files and clone it, but cannot push or open issues or pull requests.
ergast-py/ergast_py/models/pit_stop.py
2022-06-01 14:31:52 +01:00

29 lines
951 B
Python

from dataclasses import dataclass
import datetime
@dataclass
class PitStop:
"""
Representation of a single Pit Stop from a Formula One race
PitStops may contain:
driverId: String
lap: Integer
stop: Integer
localTime: datetime.datetime
duration: datetime.time
"""
def __init__(self, driverId: str, lap: int, stop: int, localTime: datetime.datetime,
duration: datetime.time) -> None:
self.driverId = driverId
self.lap = lap
self.stop = stop
self.localTime = localTime
self.duration = duration
pass
def __str__(self):
return f"PitStop(driverId={self.driverId}, lap={self.lap}, stop={self.stop}, localTime={self.localTime}, duration={self.duration})"
def __repr__(self):
return f"PitStop(driverId={self.driverId}, lap={self.lap}, stop={self.stop}, localTime={self.localTime}, duration={self.duration})"