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, schedule tools, circuit plotting, and interactive race replay.

Installation

pip install f1-replay

Quick Start

from f1_replay import Manager

mgr = Manager()

# Launch interactive race replay
mgr.race(2024, "monaco")

# Browse season schedule
mgr.season_schedule(2024)

# Load and explore data
weekend = mgr.load_weekend(2024, "monaco")
session = mgr.load_race(2024, "monaco")

# Access telemetry
session.telemetry["VER"]       # Polars DataFrame
session.drivers                # ["VER", "NOR", "LEC", ...]

# Generate circuit poster
weekend.plot(color_mode="speed")

Features

  • 3-Tier Data Management -- Hierarchical caching for seasons, weekends, and sessions with automatic pickle storage
  • Schedule Tools -- Query race calendars, browse events, resolve races by name or round number
  • Circuit Plotting -- Poster-style track maps with speed, throttle, brake, height, and sector coloring
  • Race Replay -- Interactive 2D viewer with animated car positions, live standings, strategy panel, track status overlays, rain effects, and race control messages

CLI

f1-replay race 2024 monaco              # Launch race replay
f1-replay race 2024 8 --port 8080       # By round number
f1-replay seasons 2024                  # List races
f1-replay server                        # API server only
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.14.tar.gz (121.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.14-py3-none-any.whl (117.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: f1_replay-0.1.14.tar.gz
  • Upload date:
  • Size: 121.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.14.tar.gz
Algorithm Hash digest
SHA256 4b20f30653b48ab2cb3d3529bc6afd1fa298db4108d85d9daeb6b698c15f53bc
MD5 44ed8cf78b7f796178293071e280b2fb
BLAKE2b-256 61f50734ea8312e165cf49553e6d60a54b4cff38f1e5cf4247811ec5ac829787

See more details on using hashes here.

File details

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

File metadata

  • Download URL: f1_replay-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 117.5 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.14-py3-none-any.whl
Algorithm Hash digest
SHA256 3676aaa125f9e342d4ee90a57662874901b13beeac186621bf2a6eef841b36a0
MD5 bdd2e865412219c020311925bfbb298a
BLAKE2b-256 4d5744f33f1251474bda6e892555e3d12c33b0dd4a07f662cad58328aaea58c1

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