A comprehensive command-line tool for analyzing Formula 1 race data using the FastF1 library.
F1 Statistics Dashboard is a Python application that provides detailed statistics, visualizations, and analysis of Formula 1 race data. From viewing race schedules to comparing driver performances across seasons, this tool offers F1 fans and data enthusiasts a powerful way to explore the world of Formula 1 racing.
- Race Schedules: View full season calendars for any F1 season
- Race Results: Get detailed results from specific races
- Grand Prix Summaries: Comprehensive information about each race including winners, podiums, fastest laps, and team points
- Podium Counts: Track podium finishes for each driver in a season
- DNF Analysis: Analyze driver retirements and non-finishes
- Driver Comparisons: Compare two drivers' performances across multiple seasons
- Driver Points Charts: Visualize points distribution for each race
- Performance Trends: Track drivers and teams across a season
- Season Details Export: Export complete season data to CSV files
- Historical Data Export: Compile data across multiple seasons
- Race Result Exports: Save individual race results
- Python 3.7 or higher
- pip package manager
pip install fastf1 pandas matplotlib tabulate# Clone the repository
git clone https://github.com/akhi07rx/F1-Statistics-Dashboard.git
cd f1-statistics-dashboard
# Install required dependencies
pip install -r requirements.txtThe easiest way to use the dashboard is through its interactive menu:
python f1_dashboard.py --menuThis opens a user-friendly interface organized into the following sections:
- View Race Schedule
- Race Results & Analysis
- Driver Statistics
- Season Analysis
- Historical Data
- Export Options
You can also access specific features directly through command-line arguments:
# Display current season schedule
python f1_dashboard.py
# Show race schedule for a specific year
python f1_dashboard.py --schedule 2023
# Get race results and generate points chart
python f1_dashboard.py --results 2023 5
# Get fastest lap information
python f1_dashboard.py --fastest 2023 22
# Count podiums for each driver in a season
python f1_dashboard.py --podiums 2023
# Count DNFs for each driver in a season
python f1_dashboard.py --dnfs 2023
# Compare two drivers across seasons
python f1_dashboard.py --compare VER HAM 2021 2023
# Generate a Grand Prix summary
python f1_dashboard.py --summary 2023 22
# Export full season details to CSV
python f1_dashboard.py --export-season 2023
# Export race data for a date range
python f1_dashboard.py --export-history 2010 2023For a full list of available commands:
python f1_dashboard.py --helpfrom f1_dashboard import F1Dashboard
dashboard = F1Dashboard()
dashboard.display_race_schedule()dashboard = F1Dashboard()
dashboard.grand_prix_summary(2023, 5) # Monaco Grand Prix 2023dashboard = F1Dashboard()
dashboard.compare_drivers('VER', 'HAM', range(2021, 2024)) # Compare Verstappen and Hamilton from 2021-2023dashboard = F1Dashboard()
results, drivers, teams = dashboard.export_full_season_details(2023)The dashboard creates the following data files:
| File | Description |
|---|---|
race{N}_results_{YEAR}.csv |
Results for a specific race |
race{N}_points_{YEAR}.png |
Points visualization for a specific race |
podiums_{YEAR}.csv |
Podium counts for a season |
dnfs_{YEAR}.csv |
DNF counts for a season |
full_season_{YEAR}_results.csv |
Complete race-by-race results for a season |
driver_standings_{YEAR}.csv |
Driver championship standings |
team_standings_{YEAR}.csv |
Team/constructor championship standings |
all_f1_races_{START}_to_{END}.csv |
Historical race data for a date range |
The dashboard uses FastF1's cache system to improve performance and reduce API calls. The cache is stored in the f1_cache directory, which is created automatically.
Error getting race results for {year} round {race_round}: ...
Check your internet connection. The FastF1 library requires internet access to load data.
If you encounter this error:
NotADirectoryError: Cache directory does not exist!
The application should create this directory automatically, but you can manually create an f1_cache directory in the same location as the script.
If charts don't display properly, ensure you have a working display server or try exporting to image files instead.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- FastF1 - The amazing library that makes this dashboard possible
- Formula 1 - For providing the data through their API
- All the contributors to Pandas, Matplotlib, and other libraries used in this project
Disclaimer: This is an unofficial application and is not associated with, endorsed by, or affiliated with Formula 1 or the FIA Formula One World Championship.