Skip to main content

Formula 1 Race Replay and Visualization Library

Project description

f1-replay

PyPI version Python 3.9+ License: MIT

A Python toolkit for Formula 1 data analysis and visualization. Built on FastF1 with intelligent caching, circuit plotting, and interactive race replay.

Installation

pip install f1-replay

Quick Start

Race Replay

Watch any historic race with an interactive 2D viewer:

from f1_replay import Manager

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

Or from the command line:

f1-replay 2024 monaco

The viewer includes animated car positions, live standings with gap times, strategy panel, track status overlays (safety car, VSC, red flags), rain effects, race control messages, and more.

Circuit Plotting

Generate poster-style circuit maps:

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.

Requirements

  • Python 3.9+
  • FastF1, Flask, Polars, NumPy, SciPy, Pandas
  • Optional: matplotlib (circuit plots), orjson (faster JSON), flask-cors

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.15.tar.gz (122.1 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.15-py3-none-any.whl (117.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: f1_replay-0.1.15.tar.gz
  • Upload date:
  • Size: 122.1 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.15.tar.gz
Algorithm Hash digest
SHA256 30950251b95b9268c5e8e15dd967397e3afb6cdac3041a841226bcc019b5c7af
MD5 86b65345752f80ef0e2fe92a236134a2
BLAKE2b-256 5b0619db956bc91c052b377347f39a9887902de0ff4d28af2776e9425cb95f61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: f1_replay-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 117.9 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.15-py3-none-any.whl
Algorithm Hash digest
SHA256 45a6a4452e4dd0fd01c9bb4ec3e3ba2b7e3b4e74b96aea65bf7d072d38967587
MD5 d1fc315ba7464a400a1eee841012ea21
BLAKE2b-256 cd3b7958c8a0f40af62f3982dee957fb8cb3695167bda16796b54c4a88811c4b

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