Functions
get_session()
Create a Session object based on year, event name and session identifier.int
required
Championship year
str | int
required
Name as str or round number as int. If gp is a string, a fuzzy match will be performed on all events and the closest match will be selected. Fuzzy matching uses country, location, name and officialName of each event as reference.Examples: ‘bahrain’, ‘australia’, ‘abudabi’, ‘monza’
int | str | None
default:"None"
Session name, abbreviation or number. See event-session-identifier in the documentation.
Literal['fastf1', 'f1timing', 'ergast'] | None
default:"None"
Select a specific backend as data source:
'fastf1': FastF1’s own backend, full support for 2018 to now'f1timing': uses data from the F1 live timing API, sessions for which no timing data is available are not listed (supports 2018 to now)'ergast': uses data from Ergast, no local times are available (supports 1950 to now)
'fastf1' is used as a default and the other backends are used as a fallback. For seasons older than 2018 'ergast' is always used.bool
default:"False"
Match precisely the query, or default to fuzzy search.
Session
A Session object (without loaded data)
This function returns a Session object, but it will not load any session specific data yet. You need to call
Session.load() on the returned object.get_event()
Create an Event object for a specific season and GP.int
required
Championship year
int | str
required
Name as str or round number as int. If gp is a string, a fuzzy match will be performed on all events. Note that the round number cannot be used to get a testing event, as all testing events are round 0.
Literal['fastf1', 'f1timing', 'ergast'] | None
default:"None"
Select a specific backend as data source (same options as
get_session)bool
default:"False"
Match precisely the query, or default to fuzzy search.
Event
An Event object
get_event_schedule()
Create an EventSchedule object for a specific season.int
required
Championship year
bool
default:"True"
Include or exclude testing sessions from the event schedule.
Literal['fastf1', 'f1timing', 'ergast'] | None
default:"None"
Select a specific backend as data source (same options as
get_session)EventSchedule
An EventSchedule object containing all events for the season
get_testing_session()
Create a Session object for testing sessions.int
required
Championship year
int
required
Number of the testing event (usually at most two)
int
required
Number of the session within a specific testing event. Each testing event usually has three sessions.
Literal['fastf1', 'f1timing'] | None
default:"None"
Select a specific backend as data source (testing not supported by ergast)
Session
A Session object for the testing session
get_events_remaining()
Create an EventSchedule object for remaining events in the season.datetime.datetime | None
default:"None"
Optional DateTime to get events after. Defaults to current time.
bool
default:"True"
Include or exclude testing sessions from the event schedule.
Literal['fastf1', 'f1timing', 'ergast'] | None
default:"None"
Select a specific backend as data source
EventSchedule
An EventSchedule object with upcoming events
Classes
EventSchedule
DataFrame containing a per-season event schedule. Constructor:int
default:"0"
Championship year
RoundNumber(int): The round numberCountry(str): Country nameLocation(str): City/location nameOfficialEventName(str): Official event nameEventDate(datetime64[ns]): Date of the eventEventName(str): Short event nameEventFormat(str): Format type (‘conventional’, ‘sprint’, ‘sprint_shootout’, ‘sprint_qualifying’, ‘testing’)Session1throughSession5(str): Names of each sessionSession1DatethroughSession5Date(datetime): Local session start timesSession1DateUtcthroughSession5DateUtc(datetime64[ns]): UTC session start timesF1ApiSupport(bool): Whether F1 API supports this event
is_testing()
Return True or False, depending on whether each event is a testing event.pd.Series
Boolean series indicating testing events
get_event_by_round()
Get an Event by its round number.int
required
The round number
Event
The Event object for that round
get_event_by_name()
Get an Event by its name with fuzzy matching.str
required
The name of the event. For example, ‘british’ or ‘silverstone’ will both match the British Grand Prix.
bool
default:"False"
Search only for exact query matches instead of using fuzzy search.
Event
The matched Event object
Event
Represents a single event (race weekend or testing event). Constructor:int | None
default:"None"
Championship year
is_testing()
Return True if this is a testing event.bool
Whether this is a testing event
get_session_name()
Return the full session name of a specific session from this event.int | str
required
Session name, abbreviation or number
str
Full session name (e.g., ‘Practice 3’, ‘Qualifying’)
get_session_date()
Return the date and time at which a specific session is or was held.str | int
required
Session name, abbreviation or number
bool
default:"False"
Return a non-timezone-aware UTC timestamp
pd.Timestamp
The session date/time
get_session()
Return a Session from this event.int | str
required
Session name, abbreviation or number
Session
The Session object
get_race()
Return the race session.Session
The race Session object
get_qualifying()
Return the qualifying session.Session
The qualifying Session object
get_sprint()
Return the sprint session.Session
The sprint Session object
get_practice()
Return the specified practice session.int
required
Practice session number (1, 2, or 3)
Session
The practice Session object
