Skip to main content

Wrapper library for F1 data and telemetry API with additional data processing capabilities.

Project description

FastF1 is a python package for accessing and analyzing Formula 1 results, schedules, timing data and telemetry.

Installation

It is recommended to install FastF1 using pip:

pip install fastf1

Note that Python 3.8 or higher is required. (The live timing client does not support Python 3.10, therefore full functionality is only available with Python 3.8 and 3.9)

Alternatively, a wheel or a source distribution can be downloaded from Pypi.

Getting Started: Documentation and Examples

Furthermore, there are some great articles and examples written by other people. They provide a nice overview about what you can do with FastF1 and might help you to get started.

General Information

Usage

Creating a simple analysis is not very difficult, especially if you are already familiar with pandas and numpy.

Suppose that we want to analyse the race pace of Leclerc compared to Hamilton for the Turkish GP 2020.

import fastf1
from fastf1 import plotting
from matplotlib import pyplot as plt

plotting.setup_mpl()

fastf1.Cache.enable_cache('path/to/folder/for/cache')  # optional but recommended

race = fastf1.get_session(2020, 'Turkish Grand Prix', 'R')
race.load()

lec = race.laps.pick_driver('LEC')
ham = race.laps.pick_driver('HAM')

Once the session is loaded, and drivers are selected, you can plot the information.

fastf1.plotting provides some special axis formatting and data type conversion. This is required for generating a correct plot.

It is not necessary to enable the usage of a cache but it is recommended. Simply provide the path to some empty folder on your system.

fig, ax = plt.subplots()
ax.plot(lec['LapNumber'], lec['LapTime'], color='red')
ax.plot(ham['LapNumber'], ham['LapTime'], color='cyan')
ax.set_title("LEC vs HAM")
ax.set_xlabel("Lap Number")
ax.set_ylabel("Lap Time")
plt.show()
docs/_static/readme.svg

Compatibility

Timing data, car telemetry and position data is available for the 2018 and later seasons. Schedule information and session results are available for older seasons too. (limited to Ergast web api).

Data Sources

FastF1 uses data from F1’s live timing service.

Data can be downloaded after a session. Alternatively, the actual live timing data can be recorded and the recording can be used as a data source.

Usually it is not necessary to record the live timing data. But there have been server issues in the past which resulted in the data being unavailable for download. Therefore, you only need to record live timing data if you want to benefit from the extra redundancy.

Notice

FastF1 is unofficial software and in no way associated with the Formula 1 group of companies.

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

fastf1-2.3.3.tar.gz (76.2 kB view details)

Uploaded Source

Built Distribution

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

fastf1-2.3.3-py3-none-any.whl (79.5 kB view details)

Uploaded Python 3

File details

Details for the file fastf1-2.3.3.tar.gz.

File metadata

  • Download URL: fastf1-2.3.3.tar.gz
  • Upload date:
  • Size: 76.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for fastf1-2.3.3.tar.gz
Algorithm Hash digest
SHA256 d528595a27adaa4aac5cca58b9730d5303b18c7bb7976aa18731ee572d1d1ee8
MD5 c8758393f10795a5d7e86f27fe44863b
BLAKE2b-256 ddf9c4ea8101590e9aa7622dc18352871ef46dc1e8cde06d2dda2ec75e55debc

See more details on using hashes here.

File details

Details for the file fastf1-2.3.3-py3-none-any.whl.

File metadata

  • Download URL: fastf1-2.3.3-py3-none-any.whl
  • Upload date:
  • Size: 79.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for fastf1-2.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f844a9ab7c3073ef4c08c7c27d293e63e6972348ff916a9c519b935085d60eae
MD5 4c1a4ade7a346ae8cdbb41a3fb07840c
BLAKE2b-256 0bf584c1ab4a3b9f06bca2727ce2980ea6c26a8dc4226a0e49e559b234ba8791

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