Skip to content

7mran/FPL-Analysis-24-25

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ† Fantasy Premier League Analysis Tool

A comprehensive command-line tool for analyzing Fantasy Premier League (FPL) data, providing insights into player performance, form analysis, and value for money calculations.

πŸš€ Features

πŸ” Player Rankings & Lists

  • Top Players by Total Points β€” Season-long point leaders
  • Top Players by Pick Rate β€” Most popular players among managers
  • Top Players by Value for Money β€” Best points per million ratio
  • Players by Position β€” Filter and analyze by specific positions
  • Alphabetical & Team Sorting β€” Organized player listings

⚑️ Form & Performance Analysis

  • Recent Form Analysis β€” Track player performance over recent gameweeks
  • Historical Performance β€” Points up to specific gameweeks
  • Detailed Form Analysis β€” In-depth performance breakdowns
  • Multi-Player Form Comparison β€” Visual comparison of multiple players

πŸ“ˆ Individual Player Analysis

  • Full Gameweek History β€” Complete season performance record
  • Specific Gameweek Stats β€” Detailed stats for any gameweek
  • Points Visualization β€” Interactive charts showing point trends
  • Price Tracking β€” Monitor player price changes over time
  • Head-to-Head Comparisons β€” Compare two players side by side

🎯 Advanced Analysis

  • Custom Date Range Analysis β€” Analyze performance over specific periods
  • Custom Period Comparisons β€” Compare players over defined timeframes
  • Multi-Player Form Charts β€” Visual comparison of up to 6 players

πŸ›  Installation

βœ… Prerequisites

  • Python 3.7 or higher
  • pip package manager

βœ… Required Dependencies

pip install requests pandas tabulate matplotlib numpy

βœ… Quick Install

# Clone the repository
git clone https://github.com/yourusername/fpl-analysis-tool.git
cd fpl-analysis-tool

# Install dependencies
pip install -r requirements.txt

# Run the application
python fpl_analysis.py

⚑ Usage

βœ… Getting Started

  1. Run the application:
    python fpl_analysis.py
  2. The tool automatically fetches the latest FPL data from the official API.
  3. Navigate through the menu options using numbers (0-18).

βœ… Menu Structure

πŸ” PLAYER RANKINGS & LISTS

  1. Top players by total points
  2. Top players by pick rate
  3. Top players by value for money
  4. Players by position
  5. All players (sorted alphabetically)
  6. All players (sorted by team)

⚑ FORM & PERFORMANCE ANALYSIS

  1. Top players by recent form
  2. Top players up to specific gameweek
  3. Player form analysis (detailed)
  4. Compare multiple players' form

πŸ“ˆ INDIVIDUAL PLAYER ANALYSIS

  1. Player's full gameweek history
  2. Player's specific gameweek stats
  3. Player points chart
  4. Player price chart
  5. Compare two players' points

🎯 ADVANCED ANALYSIS

  1. Custom form analysis (date range)
  2. Custom period comparison
  3. Multi-player form comparison

❌ EXIT

  1. Exit application

πŸ” Example Usage

Finding Top Value Players

Select option: 3
How many top players to show: 10
Enter position (goalkeeper/defender/midfielder/forward) or press Enter for all: midfielder
Minimum points threshold (default 50): 75

Analyzing Player Form

Select option: 9
Enter player ID: 123
Number of recent gameweeks (default 5): 8

Comparing Players

Select option: 15
Enter first player ID: 123
Enter second player ID: 456

πŸ“Š Data Source

  • API: Official Fantasy Premier League API
  • Data Updates: Real-time data from the official FPL servers
  • Coverage: All current season data including player stats, prices, and gameweek history

πŸ“ˆ Key Metrics Explained

Value for Money

  • Calculation: Total Points Γ· Cost (in millions)
  • Purpose: Identify players providing the best return on investment

Form Analysis

  • Recent form, custom periods, and trend indicators for performance analysis.

Pick Rate

  • Percentage of FPL managers who own the player β€” useful for identifying differential picks.

βš™οΈ Technical Details

  • Language: Python 3.7+
  • API Integration: RESTful API calls to FPL endpoints
  • Data Processing: Pandas
  • Visualization: Matplotlib
  • Interface: Command-line with tabulated output

βœ… Error Handling

  • Graceful handling of network/API failures
  • Input validation
  • Clean exit on keyboard interrupts

βœ… Performance

  • Efficient data loading (single API call for season data)
  • Caching to minimize redundant requests
  • Optimized memory management

🀝 Contributing

We welcome contributions!

How to contribute:

# Fork the repository
git checkout -b feature/amazing-feature

# Make your changes
git commit -m 'Add amazing feature'
git push origin feature/amazing-feature

Open a Pull Request and describe your changes.

βœ… Areas for Contribution

  • Additional analysis features
  • Performance optimizations
  • UI/UX improvements
  • Documentation enhancements
  • Bug fixes and testing

πŸ—ΊοΈ Roadmap

  • Web interface version
  • Export functionality (CSV, PDF)
  • Historical season data
  • Team analysis features
  • Transfer suggestions
  • Fixture difficulty integration

πŸ“Œ Version History

  • v1.0: Initial release with core analysis features
  • v1.1: Added form comparison charts
  • v1.2: Enhanced error handling and user experience

πŸ›  Troubleshooting

Issue Solution
Error loading data Check internet connection & FPL API
Player ID not found Ensure valid and active player ID
Chart display issues Ensure matplotlib is installed

πŸ“ License

This project is licensed under the MIT License β€” see the LICENSE file.

πŸ™Œ Acknowledgments

  • Fantasy Premier League for providing the official API
  • Python Community for excellent data analysis libraries
  • Contributors who help improve this tool

⚠️ Disclaimer

This tool is for educational and analytical purposes only. It is not affiliated with the official Fantasy Premier League game or the Premier League.

Author: Imran Ahmed Kamal
Data Source: Fantasy Premier League API
Last Updated: July 2025

About

Fantasy Premier League data science project, analysing the statistics from the 24/25 season

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages