Skip to main content

driver_points.py

The driver_points.py script fetches driver championship standings after each race. It tracks points accumulated by drivers throughout the season.

Overview

This script:
  • Fetches driver standings from the Ergast API
  • Saves cumulative points after each round
  • Implements rate limiting and logging
  • Requires the events.json file to exist first

Functions

create_folder_if_not_exists()

driver_points.py

get_race_folder_name()

driver_points.py

fetch_with_rate_limit()

driver_points.py

fetch_driver_standings()

driver_points.py

process_round()

Main function that processes a specific round.
driver_points.py

Usage

Fetch Standings for a Round

Command Line

You must run events.py first to create the events.json file. This script depends on it to determine race folder names.

API Endpoint

Output Structure

Standings are saved to: {year}/{race-slug}/driverPoints.json

Configuration

Logging

Log file: driver_standings_fetch.log

See Also