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.

The tif1 CLI provides a powerful command-line interface for accessing Formula 1 data directly from your terminal. Built with Typer and Rich, it offers an intuitive and visually appealing way to explore F1 events, sessions, drivers, and lap data.

Installation

The CLI is included when you install tif1:
pip install tif1
Verify the installation:
tif1 version

Quick Start

List all events for a specific year:
tif1 events 2024
View sessions for an event:
tif1 sessions 2024 "Monaco"
List drivers in a session:
tif1 drivers 2024 "Monaco" "Race"

Basic Usage

The CLI follows a simple command structure:
tif1 [COMMAND] [ARGUMENTS] [OPTIONS]

Getting Help

View all available commands:
tif1 --help
Get help for a specific command:
tif1 events --help
tif1 fastest --help

Key Features

Rich Terminal Output

All commands use Rich formatting for beautiful, readable output:
  • Color-coded tables and text
  • Progress indicators for data loading
  • Structured information display

Fast Data Access

The CLI leverages tif1’s high-performance data pipeline:
  • Automatic caching for instant repeat queries
  • CDN-backed data fetching
  • Optimized DataFrame operations

Event and Session Navigation

Easily explore the F1 calendar hierarchy:
  1. List events by year
  2. View sessions for an event
  3. Drill down into session details

Driver and Lap Analysis

Access detailed performance data:
  • Driver rosters with team information
  • Fastest lap times by driver
  • Session-wide fastest lap rankings

Common Workflows

Explore a Race Weekend

# Find events in 2024
tif1 events 2024

# Check Monaco sessions
tif1 sessions 2024 "Monaco"

# View race drivers
tif1 drivers 2024 "Monaco" "Race"

# Analyze fastest laps
tif1 fastest 2024 "Monaco" "Race"

Check Specific Driver Performance

# Get fastest lap for a specific driver
tif1 fastest 2024 "Bahrain" "Qualifying" --driver VER

# Compare with all drivers
tif1 fastest 2024 "Bahrain" "Qualifying"

Manage Cache

# Check cache status
tif1 cache-info

# Clear cache to free space
tif1 cache-clear --yes

Event Name Matching

Event names are flexible and case-insensitive. The following all work:
tif1 sessions 2024 "monaco"
tif1 sessions 2024 "Monaco Grand Prix"
tif1 sessions 2024 "Monaco"
The CLI will match partial event names intelligently.

Session Types

Valid session names include:
  • Practice 1, Practice 2, Practice 3
  • Qualifying
  • Sprint Qualifying (for sprint weekends)
  • Sprint
  • Race
Shorthand versions also work:
  • FP1, FP2, FP3
  • Q, Qualifying
  • S, Sprint
  • R, Race

Year Range

The CLI supports data from 2018 to the current season. Attempting to query years outside this range will result in an error.
# Valid
tif1 events 2024
tif1 events 2018

# Invalid (pre-2018)
tif1 events 2017  # Error: Data not available

Performance Tips

Use Cache Effectively

First-time queries download data from the CDN. Subsequent queries use cached data for instant results:
# First run: ~2-5 seconds (downloads data)
tif1 drivers 2024 "Bahrain" "Race"

# Second run: <1 second (uses cache)
tif1 drivers 2024 "Bahrain" "Race"

Check Cache Size

Monitor your cache to manage disk space:
tif1 cache-info
Output shows:
  • Cache directory location
  • Number of cached files
  • Total cache size in MB

Error Handling

The CLI provides clear error messages for common issues:
# Invalid year
tif1 events 2010
# Error: Data not available for year 2010

# Event not found
tif1 sessions 2024 "InvalidEvent"
# Error: Event 'InvalidEvent' not found

# Invalid session
tif1 drivers 2024 "Monaco" "Practice 4"
# Error: Session 'Practice 4' not found

Debug Mode

Enable detailed logging for troubleshooting:
tif1 debug 2024 "Monaco" "Race"
This command:
  • Enables DEBUG-level logging
  • Shows all HTTP requests and cache operations
  • Displays data loading progress
  • Reports session statistics

Next Steps

Command Reference

Detailed documentation for all CLI commands

Python API

Use tif1 programmatically in Python

Caching Guide

Learn about cache configuration and management

Examples

See real-world usage examples

Build docs developers (and LLMs) love