A comprehensive Fantasy Premier League dashboard that provides detailed analytics, awards, and insights for your mini-league. Built with Python, Streamlit, and Google Sheets integration.
- Classic League Standings - Track overall performance
- Head-to-Head League - Monitor H2H matchups
- FPL Challenge Integration - Special challenge tracking
- Cup Status - Knockout tournament progress
- π― Shooting Stars - Rank improvement tracking
- π Transfer King - Best transfer decisions
- π‘οΈ Defensive King - Defensive contributions
- πΊ Bench King - Bench player performance
- β Dream Team - Perfect lineup selections
- π² Penalty King - Penalty point management
- π Best Captain - Captaincy decisions
- π Best Vice-Captain - Vice-captain performance
- Time Machine Rankings - Historical rank tracking
- Transfer Analysis - In/out player performance
- Chip Usage Tracking - Wildcard, Free Hit, etc.
- Live Data Integration - Real-time updates
The dashboard includes 15+ custom awards to make your mini-league more competitive:
- Performance Awards: Golden Boot, Playmaker, Defensive King
- Strategic Awards: Transfer King, Best Captain, Steady King
- Luck Awards: Dream Team King, Penalty King, Shooting Stars
- Monthly Competitions: Classic and H2H monthly standings
π For detailed award explanations, see AWARDS_GUIDE.md
- Click "Use this template" button on GitHub
- Create your own repository
- Follow the setup guide below
git clone https://github.com/your-username/fpl-dashboard-streamlit.git
cd fpl-dashboard-streamlit
Edit data_pipeline.py
and update these variables:
# --- Configuration ---
CLASSIC_LEAGUE_ID = 123456 # Your classic league ID
H2H_LEAGUE_ID = 789012 # Your H2H league ID
FPL_CHALLENGE_LEAGUE_ID = 345678 # Your FPL Challenge league ID
GOOGLE_SHEET_NAME = "FPL-Data-YourLeague" # Your Google Sheet name
How to find your League IDs:
- Classic League: Go to your league page β URL contains the ID
- H2H League: Same process for H2H leagues
- FPL Challenge: Check the FPL Challenge website
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google Sheets API and Google Drive API
- Create Service Account credentials
- Download the JSON key file
- Create a new Google Sheet
- Name it according to
GOOGLE_SHEET_NAME
- Share the sheet with your service account email
- Add the following worksheets:
Classic League
H2H League
FPL Challenge
Shooting Stars
Transfer King
Defensive King
Bench King
Dream Team
Penalty King
Best Captain
Best VC
Time Machine
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
export GCP_CREDENTIALS='{"type": "service_account", ...}' # Your service account JSON
# Run the pipeline
python data_pipeline.py
# Run the dashboard
streamlit run app.py
- Go to your repository Settings β Secrets and variables β Actions
- Add secret:
GCP_CREDENTIALS
with your service account JSON - The workflow will run automatically on schedule
- Go to Streamlit Cloud
- Connect your GitHub repository
- Add the
GCP_CREDENTIALS
secret in Streamlit Cloud settings - Deploy!
fpl-dashboard-streamlit/
βββ app.py # Main Streamlit dashboard
βββ data_pipeline.py # Data fetching and processing
βββ requirements.txt # Python dependencies
βββ .github/
β βββ workflows/
β βββ run_fpl_pipeline.yml # Automated data pipeline
βββ .streamlit/
β βββ config.toml # Streamlit configuration
βββ data/ # Local data storage (optional)
βββ README.md # This file
You can modify the awards logic in data_pipeline.py
:
# Example: Custom penalty calculation
def calculate_custom_penalty(manager_data, gw):
# Your custom logic here
return penalty_score
- Add award logic in
data_pipeline.py
- Create corresponding worksheet in Google Sheets
- Update
app.py
to display the new award
Modify app.py
to customize:
- Colors and themes
- Layout and components
- Additional visualizations
- FPL API: Official Fantasy Premier League API
- FPL Challenge API: Special challenge data
- Google Sheets: Data storage and sharing
- Live Data: Real-time player and team updates
1. "League not found" error:
- Verify your league IDs are correct
- Check if leagues are public or you have access
2. "Google Sheets permission denied":
- Ensure service account has edit access to the sheet
- Check the sheet name matches
GOOGLE_SHEET_NAME
3. "API rate limit exceeded":
- The pipeline includes automatic retry logic
- Consider reducing update frequency
4. "Missing player data":
- Some players may have incomplete history
- The system handles this gracefully with default values
# Enable debug logging in data_pipeline.py
import logging
logging.basicConfig(level=logging.DEBUG)
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Fantasy Premier League for the API
- Streamlit for the web framework
- Google Sheets for data storage
- The FPL community for inspiration
If you encounter any issues:
- Check the troubleshooting section
- Search existing issues
- Create a new issue with detailed information
Made with β€οΈ for the FPL community
Transform your mini-league into a data-driven competition!