alec-kr
F1PyStats
Python

An open-source Python3 package that provides Formula 1 data to developers.

Last updated Jul 6, 2026
61
Stars
20
Forks
4
Issues
+1
Stars/day
Attention Score
73
Language breakdown
No language data available.
Files click to expand
README

F1PyStats

⚠️ Project Status

F1PyStats is currently not maintained due to dependency on the Ergast API.

Future updates may include migration to a new data source if available. ## icon

GitHub Repo stars GitHub forks

codecov GitHub GitHub issues GitHub pull requests GitHub contributors

F1PyStats is an open-source Python3 package that provides Formula 1 data/statistics to developers. This package obtains Formula 1 data via the Ergast Developer API, and returns results in a pandas DataFrame format.

Prerequisites

Python3

Before installing the package, you should ensure your Python version is at least v3.11. If your version does not meet the requirements, please download a newer version to ensure the package works as expected.

Poetry

The package uses Poetry (v1.2 or higher) as the primary dependency management tool. To install this tool, kindly follow their official installation instructions.

Installation

// Clone the repo
$ git clone https://github.com/alec-kr/F1PyStats.git

// Install dependecies using poetry $ cd ../F1PyStats $ poetry install --only main

// Build the package if you would to use it in other projects (https://python-poetry.org/docs/cli/#build) poetry build

// Install built package (https://python-poetry.org/docs/cli/#add) poetry add ../F1Pystats/dist/f1pystats-0.1.1.whl

Usage

# Import the package
import F1PyStats as fp

The package currently contains thirteen functions | Function | Description | Returned Datatype | |----------------------------- |--------------------------------------------------------------------- |------------------- | | fp.driver_standings(year) | Returns the driver standings for a particular year | Pandas DataFrame | | fp.constructor_standings(year) | Returns the constructor standings for a specified year | Pandas DataFrame | | fp.race_winners(year) | Returns the race winners for a specified year | Pandas DataFrame | | fp.race_table(year) | Returns the race schedule for a specific year | Pandas DataFrame | | fp.laptimes(year, raceround, lap_number) | Returns the lap times for a specific lap in a particular race | Pandas DataFrame | | fp.pitstops(year, round, stopnumber, fastest) | Returns the pit stop info for a specific race/pit stop | Pandas DataFrame | | fp.finishingstatus(year,raceround) | Returns the finishing status of races in a year (or a particular race if specified) | Pandas DataFrame | |fp.getdrivers(year, raceround) | Returns information on drivers in a given year (or a particular race if specified) | Pandas DataFrame | |fp.get_constructors(year) | Returns information on constructors in a given year | Pandas DataFrame | |fp.sprintresults(year,raceround) | Returns the sprint qualifying results for a specific race | Pandas DataFrame| |fp.qualifyingresults(year, raceround) | Returns the qualifying results of a particular race | Pandas DataFrame | |fp.get_circuits(year) | Returns the circuit details of a specific race for a specific year| Pandas DataFrame | |fp.fastestlaps(year, raceround) | Returns the fastest lap for a particular race | Pandas DataFrame |

Generate API docs

The following command will generate API documentation under docs/_build.

$ poetry run nox -s docs

Contributions

Please ensure you follow our contributing guidelines when contributing in any way to this repository.

Feature Requests

Perhaps you have a great idea for a feature, but you're not sure how to implement it.

No worries! You can create a feature request, and someone will get in touch with you :grin:

Creating PRs

Know how to code and you'd like to add a feature? Feel free to create a PR :rocket:

Bug Reports

Spot an issue or bug? Please let us know by creating a bug report :bug:

Our Valuable Contributors✨

Happy Coding 👨‍💻

🔗 More in this category

© 2026 GitRepoTrend · alec-kr/F1PyStats · Updated daily from GitHub