Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/TracingInsights/tif1/llms.txt

Use this file to discover all available pages before exploring further.

Function Signature

def get_events(year: int) -> EventSchedule

Description

Get the complete event schedule for a Formula 1 season. Returns an EventSchedule object containing all championship races and testing events for the specified year. This function is an alias for get_event_schedule(year) and provides FastF1 API compatibility.

Parameters

year
int
required
Championship year to get events for. Must be 2018 or later (limited by available data).

Returns

EventSchedule
EventSchedule
A pandas DataFrame-like object with event information. Each row represents one event with the following columns:Event Identification:
  • RoundNumber (int): Official round number (0 for testing events)
  • EventName (str): Official event name
  • OfficialEventName (str): Full official event name
  • Country (str): Country where event takes place
  • Location (str): City/circuit location
Event Metadata:
  • EventDate (Timestamp): Date of the main event
  • EventFormat (str): Format type (“conventional”, “sprint”, etc.)
  • F1ApiSupport (bool): Whether F1 API supports this event
  • GmtOffset (str): GMT offset for local time
Session Information:
  • Session1, Session2, Session3, Session4, Session5 (str): Session names
  • Session1Date, Session2Date, etc. (Timestamp): Local session times
  • Session1DateUtc, Session2DateUtc, etc. (Timestamp): UTC session times
Additional Attributes:
  • year (int): Season year
Methods:
  • get_event_by_round(round_number: int) -> Event: Get event by round number
  • get_event_by_name(name: str, strict_search: bool = False) -> Event | None: Get event by name
  • get_event(identifier: int | str, strict_search: bool = False) -> Event | None: Get event by round or name

Examples

Get All Events for a Season

import tif1

# Get 2025 season schedule
events = tif1.get_events(2025)

# Display all events
print(events)

# Access specific columns
print(events[['RoundNumber', 'EventName', 'Country']])

Iterate Through Events

events = tif1.get_events(2025)

# Loop through all championship rounds
for idx, event in events.iterrows():
    if event['RoundNumber'] > 0:  # Skip testing
        print(f"Round {event['RoundNumber']}: {event['EventName']} in {event['Country']}")

Get Specific Event

events = tif1.get_events(2025)

# Get event by round number
first_race = events.get_event_by_round(1)
print(f"Season opener: {first_race.EventName}")

# Get event by name (with fuzzy matching)
british_gp = events.get_event_by_name("Silverstone")
print(f"British GP: {british_gp.EventName}")

# Get event by name (exact match only)
monaco = events.get_event_by_name("Monaco Grand Prix", strict_search=True)

Filter to Championship Rounds Only

events = tif1.get_events(2025)

# Get only championship races (exclude testing)
races = events[events['RoundNumber'] > 0]
print(f"Total championship rounds: {len(races)}")

Access Session Schedule

events = tif1.get_events(2025)

# Get first race
first_race = events.get_event_by_round(1)

# View all session names
print(first_race['Session1'])  # e.g., "Practice 1"
print(first_race['Session2'])  # e.g., "Practice 2"
print(first_race['Session3'])  # e.g., "Practice 3"
print(first_race['Session4'])  # e.g., "Qualifying"
print(first_race['Session5'])  # e.g., "Race"

# Get session dates
print(first_race['Session5Date'])     # Local time
print(first_race['Session5DateUtc'])  # UTC time

Check Sprint Weekends

events = tif1.get_events(2025)

# Find sprint race weekends
sprint_events = events[events['EventFormat'] == 'sprint']
print(f"Sprint weekends: {len(sprint_events)}")
for idx, event in sprint_events.iterrows():
    print(f"  - {event['EventName']}")

Working with Event Objects

events = tif1.get_events(2025)

# Get an Event object
monaco = events.get_event("Monaco")

# Event objects have helper methods
race_session = monaco.get_race()
qual_session = monaco.get_qualifying()
fp1_session = monaco.get_practice(1)

# Access event properties
print(f"Event: {monaco.EventName}")
print(f"Location: {monaco.Location}")
print(f"Round: {monaco.RoundNumber}")
  • get_event_schedule(year, include_testing=True) - Get schedule with testing control
  • get_event(year, gp) - Get a specific event directly
  • get_event_by_round(year, round_number) - Get event by round number
  • get_event_by_name(year, name, exact_match=False) - Get event by name

Notes

  • Events are ordered by round number for championship races, then by date for testing
  • Testing events have RoundNumber = 0
  • Fuzzy matching is used by default when looking up events by name
  • Event schedule data is cached and loaded from vendored schedules or CDN
  • Sprint weekend formats have different session structures (Sprint Shootout/Sprint Qualifying + Sprint)

See Also

Build docs developers (and LLMs) love