Skip to content

Commit

Permalink
DOC: update readme, move parts to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
theOehrly committed May 2, 2023
1 parent e615f0d commit 2113b45
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2,044 deletions.
117 changes: 25 additions & 92 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
=======
Fast F1
=======
======
FastF1
======

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

.. image:: docs/_static/readme.png
:target: docs/_static/readme.png


Main Features
=============

- Access to F1 timing data, telemetry, sessions results and more
- Full support for `Ergast <http://ergast.com/mrd/>`_ to access current and
historical F1 data
- All data is provided in the form of extended Pandas DataFrames to make
working with the data easy while having powerful tools available
- Adds custom functions to the Pandas objects specifically to make working
with F1 data quick and simple
- Integration with Matplotlib to facilitate data visualization
- Implements caching for all API requests to speed up your scripts


Installation
============
Expand All @@ -16,8 +33,6 @@ 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.

Expand All @@ -28,97 +43,15 @@ You can also install using `conda`:
conda install -c conda-forge fastf1
Getting Started: Documentation and Examples
===========================================

- `Documentation <https://theoehrly.github.io/Fast-F1/>`_.
- `Examples <https://theoehrly.github.io/Fast-F1/examples/index.html>`_.
- `Changelog <https://theoehrly.github.io/Fast-F1/changelog.html>`_.
- `Contributing <https://theoehrly.github.io/Fast-F1/contributing/index.html>`_.

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.

- `Accessing Formula-1 Race's historical data using Python (medium.com) <https://pandeyparul.medium.com/accessing-formula-1-races-historical-data-using-python-b7c80e544f50>`_
- `Formula 1 Data Analysis Tutorial - 2021 Russian GP: "To Box, or Not to Box?" (medium.com) <https://medium.com/@jaspervhat/formula-1-data-analysis-tutorial-2021-russian-gp-to-box-or-not-to-box-da6399bd4a39>`_
- `How to Analyze Formula 1 Telemetry in 2022 - A Python Tutorial (medium.com) <https://medium.com/towards-formula-1-analysis/how-to-analyze-formula-1-telemetry-in-2022-a-python-tutorial-309ced4b8992>`_


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.

.. code:: python
import fastf1
from fastf1 import plotting
from matplotlib import pyplot as plt
plotting.setup_mpl()
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.

:code:`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.

.. code:: python
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()
.. image:: docs/_static/readme.svg
:target: 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 <http://ergast.com/mrd/>`_).


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.
Documentation
=============

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.
The official documentation can be found here:
`https://theoehrly.github.io/Fast-F1/ <https://theoehrly.github.io/Fast-F1/>`_


Notice
------
======

FastF1 and this website are unofficial and are not associated in any way with
the Formula 1 companies. F1, FORMULA ONE, FORMULA 1, FIA FORMULA ONE WORLD
Expand Down
Binary file added docs/_static/readme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2113b45

Please sign in to comment.