Skip to main content

Formula 1 Race Replay and Visualization Library

Project description

F1-Replay — Interactive Formula 1 Race Replay & Circuit Visualization

PyPI version Python 3.9+ License: MIT Documentation

Replay any historic Formula 1 race as an animated 2D map with real telemetry data, live timing, strategy overlays, and circuit visualizations. Built on FastF1 with intelligent caching and a Flask-based viewer.

Why F1-Replay?

  • Watch any race — Animated car positions on a real circuit map with sub-second telemetry
  • Live timing overlay — Gap times, position changes, pit stops, and tyre strategy in real time
  • Track status — Safety car, VSC, red flag overlays and rain effects rendered on canvas
  • Circuit posters — Generate publication-quality circuit maps colored by speed, sectors, throttle, brake, or elevation
  • One commandf1-replay 2024 monaco and you're watching the race in your browser
  • Python API — Full programmatic access to seasons, weekends, sessions, and telemetry DataFrames (Polars)

Quick Start

pip install f1-replay

Race Replay

from f1_replay import Manager

mgr = Manager()
mgr.race(2024, "monaco")

Or from the command line:

f1-replay 2024 monaco

Opens an interactive viewer at http://localhost:8080 with animated car positions, live standings, strategy panel, race control messages, and more.

Circuit Plotting

mgr = Manager()
weekend = mgr.load_weekend(2024, "monaco")

weekend.plot()                        # Clean white track
weekend.plot(color_mode="speed")      # Colored by speed
weekend.plot(color_mode="sectors")    # Marshal sectors
weekend.plot(save_path="monaco.png")  # Save to file

Color modes: white, sectors, speed, throttle, brake, height

CLI

f1-replay 2024 monaco                  # Race replay (shorthand)
f1-replay 2024 8                       # By round number
f1-replay race 2024 monaco -p 9000     # Custom port
f1-replay seasons 2024                 # List races
f1-replay config --set-cache-dir /data # Set cache location

Documentation

Full documentation at f1-replay.readthedocs.io

Development

git clone https://github.com/kkollsga/f1-replay.git && cd f1-replay
make install   # pip install -e ".[dev,all]"
make check     # lint + tests (196 tests)
make docs      # build Sphinx documentation

See CONTRIBUTING.md for the full development guide.

License

MIT

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

f1_replay-0.1.19.tar.gz (166.8 kB view details)

Uploaded Source

Built Distribution

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

f1_replay-0.1.19-py3-none-any.whl (163.8 kB view details)

Uploaded Python 3

File details

Details for the file f1_replay-0.1.19.tar.gz.

File metadata

  • Download URL: f1_replay-0.1.19.tar.gz
  • Upload date:
  • Size: 166.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for f1_replay-0.1.19.tar.gz
Algorithm Hash digest
SHA256 4f37814ccd300f6b83496ea879e07e5e9db9665ce7e82b6c6c6a934e586b0420
MD5 e59dae30de5f1c453a02ef5c65812b7c
BLAKE2b-256 e46811f5d37c1b3a626b62d70783b1b7da4579b55bb524ea88b89a0d6497fd6f

See more details on using hashes here.

File details

Details for the file f1_replay-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: f1_replay-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 163.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for f1_replay-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 b471cf3712e81b8aa8c3b04577eb68c2db6209667056f9730ae91dc7c12953d0
MD5 5b890c279a9f5684fdd0fcbc080422e2
BLAKE2b-256 20ffe9637372fd9014f1ec3757c2749b73419f7d7c13b728736cf8bc8388b24e

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