Skip to main content

team_points.py

The team_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 the ConstructorStandingsFetcher 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
Attributes:
  • base_dir: Root directory for data storage
  • requests_this_hour: Counter for hourly rate limit tracking
  • hour_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

See Also