A comprehensive Formula 1 data analytics dashboard built with Streamlit and FastF1 library. Analyze F1 sessions in real-time with interactive visualizations and advanced analytics.
- Race Sessions: Complete race analysis with position changes and lap times
- Sprint Races: Sprint race performance analysis (2021 onwards)
- Qualifying: Q1, Q2, Q3 session breakdowns
- Practice Sessions: FP1, FP2, FP3 detailed analysis
- Lap Time Comparisons: Real-time lap time analysis across drivers
- Position Changes: Track position evolution throughout sessions
- Sector Analysis: Break down performance by track sectors
- Consistency Heatmaps: Driver consistency visualization
- Tire Strategy: Tire compound usage and stint analysis
- Speed Analysis: Track map speed visualization
- DNF Detection: Automatic detection of drivers who didn't finish
- Driver Performance: Comprehensive driver statistics and metrics
- Feature Engineering: Advanced lap time and consistency calculations
- Real-time Data: No local caching - fresh data every session
- Responsive Design: Works on desktop and mobile devices
- Interactive Controls: Easy session and driver selection
- Data Export: Download analysis results as CSV files
- Modern UI: Beautiful F1-themed interface
- Python 3.8 or higher
- Internet connection (for F1 data access)
- pip package manager
-
Clone the repository
git clone https://github.com/yourusername/f1-data-analytics.git cd f1-data-analytics -
Install dependencies
pip install -r requirements.txt
-
Test your setup
python test_setup.py
-
Launch the application
streamlit run app.py
The dashboard will open in your browser at http://localhost:8501
Choose from the available session types:
- π Race: Full race analysis
- β‘ Sprint Race: Sprint race analysis (2021+)
- π Qualifying: Qualifying session analysis
- π Practice 1/2/3: Practice session analysis
- Select any year from 2018 onwards (when FastF1 data is most reliable)
- Pick the specific F1 event from the dropdown menu
- Click "Load Session Data" to fetch fresh data
- Explore different analysis tabs
- Filter by specific drivers
- Export results as needed
F1 Data Analysis/
βββ π app.py # Main Streamlit application
βββ π requirements.txt # Python dependencies
βββ π README.md # Project documentation
βββ π QUICKSTART.md # Quick start guide
βββ π test_setup.py # Setup verification script
βββ π .gitignore # Git ignore rules
βββ π assets/
β βββ π styles.css # Custom CSS styling
βββ π src/
βββ π __init__.py
βββ π data_fetcher.py # FastF1 data retrieval
βββ π data_processor.py # Data cleaning & feature engineering
βββ π visualizations.py # Plotly chart generation
βββ π utils.py # Helper functions
- FastF1 Library: Official Formula 1 data access
- Real-time Fetching: No local storage required
- Comprehensive Coverage: All F1 sessions and events
- Streamlit: Web application framework
- FastF1: F1 data access library
- Plotly: Interactive visualizations
- Pandas: Data manipulation and analysis
- NumPy: Numerical computations
- No Local Caching: Fresh data every session
- Efficient Processing: Optimized data cleaning and feature engineering
- Responsive UI: Fast loading and smooth interactions
- Best lap time identification
- Average lap time calculations
- Lap time consistency metrics
- Rolling average analysis
- Individual driver statistics
- Position change tracking
- Sector time breakdowns
- Consistency scoring
- Tire compound analysis
- Stint length calculations
- Pit stop strategy insights
- DNF detection and analysis
- Driver-to-driver comparisons
- Session-to-session analysis
- Year-over-year trends
- Team performance analysis
The dashboard uses custom CSS for F1-themed styling:
- F1 red color scheme (
#e10600) - Responsive design elements
- Custom animations and transitions
- Professional data visualization styling
- Extend modules in the
src/directory - Add new visualizations in
visualizations.py - Create additional data processors in
data_processor.py - Modify the UI in
app.py
Import Errors
pip install -r requirements.txt --upgradeFastF1 Connection Issues
- Ensure stable internet connection
- Check firewall/proxy settings
- Try different session/event combinations
No Data Available
- Some sessions may not have data
- Try different years or events
- Sprint races only available from 2021
Slow Loading
- First-time loading may be slower
- Subsequent loads will be faster
- Check internet connection speed
- Run the test script:
python test_setup.py - Check your internet connection
- Try different session combinations
- Ensure Python 3.8+ is installed
We welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- FastF1 Team: For providing excellent F1 data access
- Streamlit Team: For the amazing web app framework
- Formula 1: For providing the official data
- Plotly: For interactive visualization capabilities
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the troubleshooting section
- Review the quick start guide
Built with β€οΈ for the F1 community
This project is not affiliated with Formula 1 or any official F1 entities.