Skip to main content

Plot F1 telemetry data using FastF1

Project description

F1_lap_time_telementary

This module is created to easily visualize telementary data of the fastest lap from a session. It heavily uses the great FastF1 API below - https://github.com/theOehrly/Fast-F1/tree/master

This document goes through all available API functions, if you just want a quick way to plot then review the plot_comparison function

Installation

pip install fastf1plot

API Functions

setup_plotting

Calls fastf1.plotting.setup_mpl from FastF1 to configure the plot

Inputs

No inputs

Output

Setup matplotlib for use with fastf1 - Nothing returned from the function

Usage

from F1_lap_time_telementary import setup_plotting

setup_plotting()

get_session_data

Gets the session data from FastF1

Inputs

year - Year of the race as an integer gp - The full name of the gp as a string session_type - Abbreviated session names, mapped as the following:

session_type Session
'FP1' Free Practice 1
'FP2' Free Practice 2
'FP3' Free Practice 3
'SQ' Sprint Qualifying
'SS' Sprint Shootout
'Q' Qualifying
'S' Sprint
'R' Race

Note Sprint Shootout is for 2023 only

Outputs

session - Returns a session object

Usage

from F1_lap_time_telementary import get_session_data

year = 2025
grand_prix = 'Chinese Grand Prix'
session_type='Q'
session = get_session_data(year, grand_prix, session_type)

get_driver_data

Returns the telementary data from the driver's fastest lap

Inputs

session - A session object (which can be obtained by running get_session_data) driver - Three letter abbreviation for a driver. E.g. 'BOT' for Bottas

Output

lap - The fastest lap set by the driver in that session car_data - telementary data from the fastest lap

Usage

from F1_lap_time_telementary import get_driver_data

session = get_session_data(2025, 'Chinese Grand Prix', 'Q')
driver = 'ALO'
lap, car_data = get_driver_data(session, driver)

get_min_max_speed

Gets the minimum and maximum speed by the driver

Inputs

car_data - Telementary Data from the car (which can be obtained by running get_driver_data)

Outputs

min_speed - Slowest speed of the car in a lap max_speed - Top speed of the car in a lap

Usage

from F1_lap_time_telementary import get_min_max_speed

min_speed, max_speed = get_min_max_speed(car_data)

plot_corners

Plots corner lines in a speed-distance plot

Inputs

ax - Axes circuit_data - Circuit Data (Obtained by session.get_circuit_info) car_data - Telementary Data from the car (which can be obtained by running get_driver_data)

Outputs

No output - Adds vertical dashed lines on a speed-distance plot

Usage

from F1_lap_time_telementary import get_min_max_speed

plot_corners(axs[0], circuit_data, car_data)

plot_telemetry

Plots telementry data 4 subplots -

  1. Speed-Distance
  2. Throttle-Distance
  3. Brake-Distance
  4. Gear-Distance

Inputs

axs - The axes you are plotting on car_data - Telementary Data from the car (which can be obtained by running get_driver_data) label - The driver's trace that is being plotted

Outputs

Nothing returned - plots a (4,1) subplot

Usage

from F1_lap_time_telementary import plot_telemetry
lap, car_data = get_driver_data('Q', 'ALO')
plot_telemetry(axs, car_data, lap)

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_lap_time_telementary-0.1.1.tar.gz (3.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_lap_time_telementary-0.1.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file f1_lap_time_telementary-0.1.1.tar.gz.

File metadata

  • Download URL: f1_lap_time_telementary-0.1.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.4

File hashes

Hashes for f1_lap_time_telementary-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4a0c6ad629adb3772c3394e1b69c56e0861f2937883d7f99ffb38aea61598582
MD5 6a8fc6ba57414998430495f5e2e03ca2
BLAKE2b-256 72712ac5cc908a21135ae69b982ea5daab209f881a8d542624c7d67d425cddb6

See more details on using hashes here.

File details

Details for the file f1_lap_time_telementary-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for f1_lap_time_telementary-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77451e0c98d5ec367728920dc9863ecd00686bdcafc0bf51669cdce001e76989
MD5 753e83b928d62c91c858fb41d42007d9
BLAKE2b-256 736b5799cceb4d6fbd24295c3e7e39652761c040b8804f90feb36e4b44ccd4bd

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