Add FPL dashboard with player analytics and transfer insights#49
Open
328345 wants to merge 24 commits intoolbauday:mainfrom
Open
Add FPL dashboard with player analytics and transfer insights#49328345 wants to merge 24 commits intoolbauday:mainfrom
328345 wants to merge 24 commits intoolbauday:mainfrom
Conversation
Build a frontend dashboard with 6 views to help with FPL transfer decisions: - Player Rankings: sortable/filterable table with key FPL metrics - Fixture Difficulty: Elo-based color-coded grid of upcoming fixtures - Value Picks: best points-per-million players by position with scatter plot - Form Trends: per-gameweek line charts for points/xG/xA - Player Comparison: side-by-side radar charts for 2-3 players - Transfer Activity: most transferred in/out, price risers/fallers Reads directly from existing CSV data files with cached loading. https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
Generates dashboard.html - a single self-contained file that works in any browser without running a server. Run with: python3 generate_dashboard.py Embeds all 822 player records, 158 fixture entries and 10 GWs of per-GW stats directly into the HTML as JSON. Uses Chart.js via CDN for charts. https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
Copies dashboard.html to public/index.html for Netlify hosting. https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
Reduces upload size from 100MB+ to ~2MB by excluding data/, scripts/, and Python files not needed for the static dashboard. https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
- Sidebar collapses into a slide-out menu on screens < 768px - Added mobile header with hamburger toggle button - Overlay backdrop when sidebar is open - Responsive adjustments for controls, tables, cards, charts - Smaller font sizes and tighter padding on small screens https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
…ard in CI - Add mobile hamburger menu, responsive CSS, and sidebar toggle to generate_dashboard.py so regenerated dashboards include mobile support - Update update_data.yml workflow to run generate_dashboard.py after data pull, so dashboard.html stays current with latest FPL data https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
Claude/fpl transfer dashboard lti q5
The delete operation wasn't batched like the insert operation, causing "Transaction too big" errors when subcollections had 500+ docs. https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
Merge pull request #1 from 328345/claude/fpl-transfer-dashboard-ltiQ5 - Fix Firestore transaction too big error
The upstream repo uses Supabase for data import, but this fork doesn't have credentials configured, causing scheduled failures. https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
Fetches latest data/ from olbauday/FPL-Elo-Insights at 6am and 5pm UTC, regenerates the dashboard, and commits if there are changes. https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
Claude/fpl transfer dashboard lti q5 Fix Firestore batch deletes, disable Supabase import, add upstream sync
Previously the sync script processed every gameweek folder on each run, causing ~50min runtime and excessive Firestore reads/writes. Now it only syncs the highest-numbered gameweek. Also adds a 10-minute timeout to the workflow as a safety net. https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
Merge pull request #3 from 328345/claude/fpl-transfer-dashboard-ltiQ5
All 38 GW folders exist with fixture data, so picking the highest number synced GW38 (future). Now checks matches.csv for finished=True and syncs the most recent gameweek that has actually been played. https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
Checks the 'matches' subcollection for the latest finished GW before uploading. If data already exists, exits early to avoid redundant writes on daily CI runs. https://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a comprehensive Fantasy Premier League (FPL) analytics dashboard built with Streamlit, featuring player rankings, transfer activity analysis, fixture difficulty ratings, and performance trend tracking.
Key Changes
Core Data Loading (
dashboard/data_loader.py)get_master_player_df()to join player stats with team and player metadataget_upcoming_fixtures()to retrieve upcoming matches with Elo-based difficulty ratingsget_recent_form_data()to load per-gameweek performance history for trend analysisDashboard Views
player_rankings.py): Sortable player table with multiple metrics (form, PPG, xG, xA, value, etc.) and search functionalityfixture_difficulty.py): Color-coded fixture grid using Elo ratings to visualize match difficulty across upcoming gameweeksvalue_picks.py): Position-based value analysis with points-per-million metrics and price vs. points scatter plotform_trends.py): Multi-player performance tracking with gameweek-by-gameweek points and expected stats visualizationplayer_comparison.py): Side-by-side stats comparison with normalized radar charts for up to 3 playerstransfer_activity.py): Transfer in/out rankings, price changes (gameweek and season), and gameweek highlightsMain Application (
dashboard/app.py)Data Synchronization (
sync_to_firestore.py)CI/CD (
github/workflows/sync.yml)Notable Implementation Details
@st.cache_datadecorator with 30-minute TTL for performancehttps://claude.ai/code/session_01FiVSPeDMHuDNYTzLuFxC26