tif1.
Prerequisites
Complete these prerequisites before the first use:- Python 3.11 or higher (3.11 through 3.15 are tested in CI)
- pip or uv package manager
- Basic knowledge of pandas or polars
- Internet connection for data fetching
Installation
1
Install tif1
Install with pip or uv:
2
Verify Installation
Check that tif1 is installed correctly:
The First Analysis
Load and analyze data from a recent race.Step 1: Load a session
The first session load fetches data from the CDN. Subsequent loads read from the cache.
Step 2: Explore drivers
session.drivers holds driver numbers as strings. session.drivers_df["Driver"] holds the 3-letter codes that get_driver expects.Step 3: Analyze lap times
LapTime and the sector times are pandas Timedelta values. Use LapTimeSeconds for arithmetic with plain numbers.Step 4: Compare drivers
Step 5: Analyze telemetry
Common Patterns
Finding available data
Check the available data before a load:Filtering Laps
Clean and filter the lap data for analysis:Analyzing tire strategy
Weather Analysis
Performance Tips
Use async code in an event loop
session.laps already fetches the lap data in parallel. Inside a running event loop, await laps_async() instead:
Batch telemetry fetching
Do not fetch telemetry one driver at a time in a loop:Use Polars for large datasets
Visualization
Create a quick visualization:Error Handling
Handle the common errors:Configuration
Customize the tif1 configuration:tif1 reads cache_dir when it opens the cache for the first time in a process. To use a different cache directory, set TIF1_CACHE_DIR or cache_dir in .tif1rc before the first data access. To enable debug logging, call tif1.setup_logging(logging.DEBUG).Next Steps
With the basics in place, explore further:Tutorials
Learn advanced analysis techniques.
API Reference
Explore the complete API.
Best Practices
Learn recommended patterns.
Examples
See more code examples.
Common Issues
Cache permission errors
If permission errors occur:Network Timeouts
If requests time out:Memory Issues
For large datasets, use the polars lib:Getting Help
FAQ
Common questions and answers
Troubleshooting
Solve common problems
GitHub Issues
Report bugs or request features
Contributing
Contribute to tif1
Related Pages
Quickstart
Quick 30-second start
Best Practices
Recommended patterns
Examples
Common use cases
Tutorials
Step-by-step guides