Skip to main content

F1 team radio clips enriched with full race context — positions, gaps, tyres, events, overtakes

Project description

f1radio

F1 team radio clips with full race context. Built on OpenF1.

Load any session from 2023 onwards — every radio clip comes enriched with position, tyres, gaps, flags, overtakes, and pit stops. Everything is cached locally so you only hit the API once.

Installation

pip install f1radio

Optional extras for audio playback and transcription:

pip install 'f1radio[playback]'       # audio playback
pip install 'f1radio[transcribe]'     # whisper transcription (coming soon)
pip install 'f1radio[all]'            # everything

Note: If you're using zsh (default on macOS), you need quotes around the brackets — 'f1radio[playback]' instead of f1radio[playback].

Requirements: Python 3.9+. No API keys needed.

Quick Start

import f1radio

# load a session — race names are fuzzy matched
session = f1radio.load(2024, "Monza", "R")

# browse clips
for clip in session.clips:
    print(f"{clip.driver} | Lap {clip.lap} | P{clip.context.position} | {clip.context.compound}")

# filter by driver
for clip in session.clips.filter(driver="VER"):
    print(clip)
    clip.play()  # requires playback extra

# export
session.export_json("monza_radio.json")
session.export_csv("monza_radio.csv")

Race name matching is flexible — "Monza", "Italian", "Italy", "Italian Grand Prix" all resolve to the same session.

What You Get

Every clip is enriched with what was happening at that exact moment:

Field Example Description
position 1 Driver's position
gap_to_leader "+1.432" Gap to P1
compound "SOFT" Current tyre
tyre_age 12 Laps on current set
lap_number 14 Current lap
events ["SAFETY CAR"] Flags/events within ±30s
overtakes ["VER → NOR for P2"] Nearby overtakes
pit_stops ["HAM pitted"] Nearby pit activity
clip = session.clips[0]
ctx = clip.context

print(ctx.position)       # 1
print(ctx.compound)       # "SOFT"
print(ctx.tyre_age)       # 12
print(ctx.events)         # ["YELLOW FLAG - Turn 4"]

CLI

f1radio download 2024 Monza R     # download and cache a session
f1radio info 2024 Monza R         # show session metadata
f1radio cache list                # see what's cached
f1radio cache clear               # clear everything

Caching

Sessions are cached after first load — subsequent calls are instant with zero API requests. Cache is cleaned up automatically after 30 days of inactivity.

f1radio.cache_info()       # see cached sessions and sizes
f1radio.clear_cache()      # wipe everything

API Responsibility

Built to be a respectful consumer of the OpenF1 API:

  • Rate limited — 2.5 req/sec, 28 req/min (under the API's limit of 3/s)
  • Circuit breaker — stops after repeated 429s to avoid bans
  • Conditional requests — ETag headers to skip unchanged data
  • Transparentf1radio.stats shows exactly how many API calls were made

Supported Sessions

Code Session
R Race
Q Qualifying
S Sprint
SQ Sprint Qualifying
FP1 Free Practice 1
FP2 Free Practice 2
FP3 Free Practice 3

Data available from the 2023 season onwards (OpenF1 limitation).

Data Source

All data comes from OpenF1 under CC BY-NC-SA 4.0. Audio files are hosted by Formula One Management.

This package is for personal and non-commercial use. See the NOTICE file for details.

License

Apache 2.0 — see LICENSE.

Contributing

See CONTRIBUTING.md for development setup and guidelines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

f1radio-1.0.3.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

f1radio-1.0.3-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

Details for the file f1radio-1.0.3.tar.gz.

File metadata

  • Download URL: f1radio-1.0.3.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for f1radio-1.0.3.tar.gz
Algorithm Hash digest
SHA256 3119cf768620f212d816b03328008bc750ffec25014961d1efb4251e2a6b04bc
MD5 5b04a95e9449d681f9a7bd5584509864
BLAKE2b-256 89c6b14418bf88b73d335d3209a0c6c3593e151321761c8b54aaed0b46ceaea4

See more details on using hashes here.

File details

Details for the file f1radio-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: f1radio-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 33.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for f1radio-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7e585b570f05b5b7b5da0d26694d8a6a1e198b662ec96450b6c5949511715a39
MD5 c88387f5fe2ed799d40762b555f23e83
BLAKE2b-256 b3e03bddfb8b4429ed0f57ad565ab1ff0af8183053dfcab42059a9f8ace9b624

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page