Skip to main content

Fast F1

A python package for accessing F1 historical timing data and telemetry.

General Information

FastF1 v2.1 is now available for installation through pip. The old way of installing via pip + git directly from the master branch is no longer recommended.

It is no longer possible to download telemetry and car position data after a session!

See this Twitter post for some information.

This means:

  • It is still possible to load timing data, tire data, track status data and session status data.

  • It is not possible to load car telemetry data (includes position data). You need to record live timing data during a session for this!

Live timing data

A live timing client has been added with the v2.1 release. The client can be used to save the live timing telemetry data stream that is available during sessions.

The live timing client does not parse data in real time! Data can only be parsed and used after a session has completed. This is a limitation of FastF1’s api parser. For various reasons there is no intention of changing this.

For usage see the documentation.

Changes

If you have used previous versions of FastF1, please read the changelog in the documentation.

V2.1 introduces some new features and some breaking changes. The documentation is improved in general. Also, there is a new section discussing how to get the most accurate results from the data that is available. It may be worth reading if you want to make more complicated analyses and visualizations.

Other

Please report bugs if (when) you find them. Feel free to report complaints about unclear documentation too.

Interested in contributing? There’s some info at the end of this document…

Installation

It is recommended to install FastF1 using pip:

pip install fastf1

Note that Python 3.8 is required.

Alternatively a wheel or a source distribution can be downloaded from the Github releases page.

Usage

Full documentation can be found here.

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 from the Bahrain GP (weekend number 2) of 2019.

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

plotting.setup_mpl()

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

race = ff1.get_session(2020, 'Turkish Grand Prix', 'R')
laps = race.load_laps()

lec = laps.pick_driver('LEC')
ham = 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 is available for the 2018, 2019 and 2020 season. Very basic weekend information is available for older seasons (limited to Ergast web api). Car telemetry data is only available as a live stream during a session. This means that you need to record this data yourself, using the provided client, if you want to have access to it.

Roadmap

This is a rather loose roadmap with no fixed timeline whatsoever.

  • Improvements to the current plotting functionality

  • Some default plots to easily allow creating nice visualizations and interesting comparisons

  • General improvements and smaller additions to the current core functionality

  • Support for F1’s own data api to get information about events, sessions, drivers and venues

Contributing

Contributions are welcome of course. If you are interested in contributing, open an issue for the proposed feature or issue you would like to work on. This way we can coordinate so that no unnecessary work is done.

Working directly on the core and api code will require some time to understand. Creating nice default plots on the other hand does not required as deep of an understanding of the code and is therefore easier to accomplish. Pick whatever you like to do.

Metadata

Release files for fastf1 2.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastf1 2.1.5
File Size Uploaded
fastf1-2.1.5.tar.gz 57.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastf1 2.1.5
File Interpreter ABI Platform
fastf1-2.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 117.4 kB

Release files / fastf1-2.1.5.tar.gz

Download URL fastf1-2.1.5.tar.gz
Size 57.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2f684c9158faa38e47b4bab58b67000f7f9fa453cc8fb95dd90c9700740dd2cd
BLAKE2b-256 checksum
How to use checksums
230d4ed285bfd261a77bcc5c918be732ca6ab78074ec22884b5cbc938b10bcdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8

Release files / fastf1-2.1.5-py3-none-any.whl

Download URL fastf1-2.1.5-py3-none-any.whl
Size 59.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da0160cb057c7b37ad1093fe8383b99d147b6e30a4aa0df460d4f6e6192ba9e1
BLAKE2b-256 checksum
How to use checksums
ed578dc6a8a1b032f590cd40d5c6f7680d54c92c779c3cb696cc871b7ae570a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8

Release history Release notifications | RSS feed

3.8.3

2 release files

3.8.2

2 release files

3.8.1

2 release files

3.8.0

2 release files

3.7.0

2 release files

3.6.1

2 release files

3.6.0

2 release files

3.5.3

2 release files

3.5.2

2 release files

3.5.1

2 release files

3.5.0

2 release files

3.4.5

2 release files

3.4.4

2 release files

3.4.3

2 release files

3.4.2

2 release files

3.4.1

2 release files

3.4.0

2 release files

3.3.9

2 release files

3.3.8

2 release files

3.3.7

2 release files

3.3.6

2 release files

3.3.5

2 release files

3.3.4

2 release files

3.3.3

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.6

2 release files

3.1.5

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.0.7

2 release files

3.0.6

1 release file

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.9

2 release files

2.2.8

2 release files

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.13

2 release files

2.1.11

2 release files

2.1.10

2 release files

2.1.9

2 release files

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

This release

2.1.5 This release

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page