[PR #265] Add live race viewer via OpenF1 API #259

Open
opened 2026-05-07 00:19:27 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/265
Author: @harrison991
Created: 3/27/2026
Status: 🔄 Open

Base: mainHead: claude/add-live-race-viewing-z1xeD


📝 Commits (1)

  • f072559 Add live race viewer via OpenF1 API

📊 Changes

6 files changed (+912 additions, -2 deletions)

View changed files

📝 main.py (+147 -1)
📝 requirements.txt (+3 -1)
📝 src/cli/race_selection.py (+17 -0)
src/interfaces/live_race.py (+202 -0)
src/live_f1_data.py (+506 -0)
📝 src/run_session.py (+37 -0)

📄 Description

Adds a --live flag (and CLI menu option) that detects an active F1 session from the OpenF1 REST API and streams live car positions, telemetry, tyre stints, weather and race-control messages into the existing Arcade visualiser.

Key changes:

  • src/live_f1_data.py: OpenF1 API client + LiveDataFeed background poller that builds frames in the same format as the replay engine.
  • src/interfaces/live_race.py: LiveRaceWindow extending F1RaceReplayWindow. Always shows the latest frame; SPACE freezes for DVR-style review; LEFT arrow steps back through the buffer; pulsing LIVE badge in top-right corner.
  • src/run_session.py: run_live_arcade_replay() helper.
  • main.py: live_main() resolves the current session, loads the circuit layout from FastF1 (qualifying → race → practice fallback), prefetches initial data, then opens the live viewer.
  • src/cli/race_selection.py: "Watch Live" shown as the first option.
  • requirements.txt: add requests and scipy (the latter was already used but not listed).

Usage:
python main.py --live # direct
python main.py --cli # pick "Watch Live" from menu


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/265 **Author:** [@harrison991](https://github.com/harrison991) **Created:** 3/27/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `claude/add-live-race-viewing-z1xeD` --- ### 📝 Commits (1) - [`f072559`](https://github.com/IAmTomShaw/f1-race-replay/commit/f0725598dca95154156a03042b3f78f20411ad49) Add live race viewer via OpenF1 API ### 📊 Changes **6 files changed** (+912 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `main.py` (+147 -1) 📝 `requirements.txt` (+3 -1) 📝 `src/cli/race_selection.py` (+17 -0) ➕ `src/interfaces/live_race.py` (+202 -0) ➕ `src/live_f1_data.py` (+506 -0) 📝 `src/run_session.py` (+37 -0) </details> ### 📄 Description Adds a --live flag (and CLI menu option) that detects an active F1 session from the OpenF1 REST API and streams live car positions, telemetry, tyre stints, weather and race-control messages into the existing Arcade visualiser. Key changes: - src/live_f1_data.py: OpenF1 API client + LiveDataFeed background poller that builds frames in the same format as the replay engine. - src/interfaces/live_race.py: LiveRaceWindow extending F1RaceReplayWindow. Always shows the latest frame; SPACE freezes for DVR-style review; LEFT arrow steps back through the buffer; pulsing LIVE badge in top-right corner. - src/run_session.py: run_live_arcade_replay() helper. - main.py: live_main() resolves the current session, loads the circuit layout from FastF1 (qualifying → race → practice fallback), prefetches initial data, then opens the live viewer. - src/cli/race_selection.py: "Watch Live" shown as the first option. - requirements.txt: add requests and scipy (the latter was already used but not listed). Usage: python main.py --live # direct python main.py --cli # pick "Watch Live" from menu --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#259
No description provided.