team_points.py
Theteam_points.py script fetches constructor (team) championship standings after each race. It tracks points accumulated by F1 constructors throughout the season.
Overview
This script uses theConstructorStandingsFetcher class to:
- Fetch constructor standings from the Ergast API
- Save cumulative team points after each round
- Implement comprehensive rate limiting (burst and sustained)
- Handle API errors gracefully
ConstructorStandingsFetcher Class
Initialization
team_points.py
base_dir: Root directory for data storagerequests_this_hour: Counter for hourly rate limit trackinghour_start_time: Timestamp for hourly window
Rate Limiting Methods
reset_hour_counter_if_needed()
team_points.py
check_rate_limits()
team_points.py
Data Fetching Methods
get_race_info()
team_points.py
get_constructor_standings()
team_points.py
fetch_standings_by_round()
team_points.py
Usage
Basic Usage
Fetch Multiple Rounds
API Endpoint
Output Structure
Constructor standings are saved to:{year}/{race-slug}/teamPoints.json
Constructor championship data is available from 1958 onwards. The 1950-1957 seasons do not have constructor standings.
Configuration
Logging
Log file:constructor_standings_fetcher.log