Skip to main content

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

Project description

Fast F1

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

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 or from Pypi.

Getting Started: Documentation and Examples

The documentation can be found here. It provides in depth information about the functionality that is available in FastF1 as well as some examples.

There are also 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 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

For more information, check the documentation here.

Compatibility

Timing data, car telemetry and position data is available for the 2018 to 2021 seasons. Very basic weekend information is available for older seasons (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.

Bugs and Issues

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

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.

Also, the documentation needs an examples section. You can provide some snippets of your code as examples for others, to help them get started easier.

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.1.10.tar.gz (62.4 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.1.10-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastf1-2.1.10.tar.gz
  • Upload date:
  • Size: 62.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for fastf1-2.1.10.tar.gz
Algorithm Hash digest
SHA256 d692db9929230dd717ec11ef44a19e13e97daf5ce458011e5f6e2974df1ce1ab
MD5 0afa268e2748f714ca844b9d23287dbc
BLAKE2b-256 b9a6dabc0b8c89308c8f4061defd1c77937ebbda45a90f5bb79cf6930885cf13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastf1-2.1.10-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for fastf1-2.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 3d555e4f237468a796d86e7ba56547838991660eac29462709d1dbc4cf6a2904
MD5 ba66aeb5117520457ff3a7f42e11c46a
BLAKE2b-256 07e4e01f8e338f30e98ac2cf4b3af016fa2c10f1cf71326bdec27b1043b631cd

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