Functions
get_session()
Create a Session object based on year, event name and session identifier.Championship year
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’
Session name, abbreviation or number. See event-session-identifier in the documentation.
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.Match precisely the query, or default to fuzzy search.
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.Championship year
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.
Select a specific backend as data source (same options as
get_session)Match precisely the query, or default to fuzzy search.
An Event object
get_event_schedule()
Create an EventSchedule object for a specific season.Championship year
Include or exclude testing sessions from the event schedule.
Select a specific backend as data source (same options as
get_session)An EventSchedule object containing all events for the season
get_testing_session()
Create a Session object for testing sessions.Championship year
Number of the testing event (usually at most two)
Number of the session within a specific testing event. Each testing event usually has three sessions.
Select a specific backend as data source (testing not supported by ergast)
A Session object for the testing session
get_events_remaining()
Create an EventSchedule object for remaining events in the season.Optional DateTime to get events after. Defaults to current time.
Include or exclude testing sessions from the event schedule.
Select a specific backend as data source
An EventSchedule object with upcoming events
Classes
EventSchedule
DataFrame containing a per-season event schedule. Constructor: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.Boolean series indicating testing events
get_event_by_round()
Get an Event by its round number.The round number
The Event object for that round
get_event_by_name()
Get an Event by its name with fuzzy matching.The name of the event. For example, ‘british’ or ‘silverstone’ will both match the British Grand Prix.
Search only for exact query matches instead of using fuzzy search.
The matched Event object
Event
Represents a single event (race weekend or testing event). Constructor:Championship year
is_testing()
Return True if this is a testing event.Whether this is a testing event
get_session_name()
Return the full session name of a specific session from this event.Session name, abbreviation or number
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.Session name, abbreviation or number
Return a non-timezone-aware UTC timestamp
The session date/time
get_session()
Return a Session from this event.Session name, abbreviation or number
The Session object
get_race()
Return the race session.The race Session object
get_qualifying()
Return the qualifying session.The qualifying Session object
get_sprint()
Return the sprint session.The sprint Session object
get_practice()
Return the specified practice session.Practice session number (1, 2, or 3)
The practice Session object
