quali_results.py
Thequali_results.py script fetches qualifying session results for Formula 1 races. It retrieves grid positions and qualifying lap times from Q1, Q2, and Q3 sessions.
Overview
This script uses theQualifyingResultsFetcher class to:
- Fetch qualifying results from the Ergast API
- Handle the modern 3-part qualifying format (Q1, Q2, Q3)
- Implement rate limiting and error handling
- Save results to structured JSON files
QualifyingResultsFetcher Class
Initialization
quali_results.py
Key Methods
get_qualifying_results()
quali_results.py
fetch_round()
quali_results.py
Usage
Basic Usage
Fetch Multiple Rounds
API Endpoint
Output Structure
Qualifying results are saved to:{year}/{race-slug}/quali_results.json
Qualifying format changed to Q1/Q2/Q3 in 2006. Earlier seasons have different formats.
Logging
Log file:qualifying_results_fetch.log