<p align="center">
<a href="https://pypi.python.org/pypi/lazyfpl"><img src="https://github.com/janbjorge/lazyFPL/blob/main/logo.png?raw=true" alt="lazyFPL"></a>
</p>
<p align="center">
<em>Fantasy Premier League Team Optimizer - Win at FPL with Laziness</em>
</p>
<p align="center">
<a href="https://github.com/astral-sh/ruff" target="_blank">
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Package version">
</a>
<a href="https://pypi.python.org/pypi/lazyfpl" target="_blank">
<img src="https://img.shields.io/pypi/v/lazyfpl.svg" alt="Package version">
</a>
<a href="https://pypi.python.org/pypi/lazyfpl" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/lazyfpl.svg" alt="Package version">
</a>
<a href="https://pypi.python.org/pypi/lazyfpl" target="_blank">
<img src="https://img.shields.io/pypi/l/lazyfpl.svg" alt="Supported Python versions">
</a>
</p>
#
The _Fantasy Premier League Team Optimizer_ employs data-driven methods for analyzing and optimizing Fantasy Premier League (FPL) team selections. It is an essential tool for FPL players who wish to leverage statistical models and optimization algorithms for a competitive advantage.
## Why Model Training is Essential
In this application, training a machine learning model is critical as it allows for nuanced understanding and prediction of FPL player performances. By analyzing historical data, the model identifies patterns and trends, offering forecasts about future player performances. These predictions are invaluable for strategic team selection and transfer decisions, providing users with a significant edge in the game.
## Modules Overview
### `backevel`
The `backevel` module is designed to validate the accuracy of the model's predictions against real-world player performances. It serves as a critical tool for assessing the model's effectiveness, enabling users to understand and improve the predictive capability of the system. This module is especially useful for refining the model's algorithms to enhance its future forecasting accuracy.
### `conf`
The `conf` module is where users can customize the application's settings and parameters. This flexibility allows for personalization according to individual strategies and preferences. It's crucial for users who want to adapt the application's functionality to their unique play style or specific requirements in the FPL.
### `ml_model`
The `ml_model` module is at the core of the application. It uses machine learning algorithms to analyze historical data and predict future player performances. This predictive capability is what makes the application so powerful for FPL players, offering insights that can inform strategic decisions for team selections and transfers.
### `optimizer`
The `optimizer` module combines the insights from the `ml_model` with the constraints defined by the user to suggest the best possible team setups. It is a sophisticated tool that leverages both data-driven predictions and user-defined strategies to maximize the performance of an FPL team.
### `populator`
The `populator` module is responsible for filling the database with data from external sources. This module ensures that the database has comprehensive and up-to-date information, which is crucial for the accuracy of the model's predictions and the effectiveness of the optimizer.
### `transfer`
In the `transfer` module, users receive guidance on managing player transfers, influenced by the model's predictions and optimization algorithms. This module helps users make informed decisions about player transfers, combining data-driven insights with strategic planning for improved team performance.
## `differentials`
The differentials module is a specialized tool designed for the Fantasy Premier League Team Optimizer. It offers analytics to identify potential differential picks in your fantasy football team. Differential picks are players who are not widely selected by other managers but have the potential to score high points, thereby giving you an edge in the competition.
## Command Line Interface (CLI) Usage
This application features a CLI, implemented via `argparse`, for straightforward interaction and execution. Below are command examples for key operations:
```bash
# Builds local player database.
python3 -m lazyfpl.populator
# Train ml-model (used to estimate expected points per player).
python3 -m lazyfpl.ml_model
# Backeval the model (optional).
python3 -m lazyfpl.backevel
# Optimize team selection based on various criteria.
python3 -m lazyfpl.optimizer --no-news --min-mtm 60
```
Obs! Step 1 and 2 must be run every gameweek to optain any new data.
## optimizer
Summary of lazyfpl.optimizer Command Output
The lazyfpl.optimizer command, with the parameters --no-news --min-mtm 60 --include Salah Haaland Alexander-Arnold, generated several team combinations for the Fantasy Premier League, focusing on optimizing the team with specific constraints and player inclusions.
- Key Players Included: The optimization specifically included Mohamed Salah, Erling Haaland, and Trent Alexander-Arnold, key players known for their high impact in FPL.
- Player Analysis: The output provided detailed analytics on various players, including expected points (xP), price, total points (TP), and upcoming matches. Notably, Erling Haaland was mentioned with a foot injury and a 50% chance of playing.
- Team Statistics: The command calculated different metrics like 'Price', 'Size', 'LxP' (Likely points), 'SxP' (Scheduled points), and 'CxP' (Combined points), providing a comprehensive overview of the team's potential performance.
- Optimization Results: The optimizer assessed numerous combinations of goalkeepers, defenders, midfielders, and forwards, totaling an astronomical number of potential team setups (in the range of 4.4e+15).
- Team Performance Scores: The summary includes schedule scores, team scores, and total scores (TSscore), indicating the balance between the team's schedule, individual player performance, and overall team synergy.
This summary provides a snapshot of the optimizer's output, showcasing its capabilities in assessing player performances, predicting future outputs, and suggesting optimal team configurations based on the given parameters
```python
Price: 99.4 Size: 15
LxP: 215.2 SxP: 277.7 CxP: 351.3
Schedule score: 15 Team score: 14 TSscore: 20.52
BIS xP Price TP UD Team Position Player Upcoming News
X 20.9 57.0 65 -0.2 Wolves FWD Cunha Chelsea - Brentford - Everton
X 19.7 76.0 58 0.6 Newcastle FWD Isak Luton - Nott'm Forest - Liverpool
X 17.5 139.0 112 0.9 Man City FWD Haaland Everton - Sheffield Utd - Newcastle Foot injury - 50% chance of playing
X 18.4 49.0 36 -0.2 Fulham MID Cairney Burnley - Bournemouth - Arsenal
X 16.9 76.0 71 0.9 Man City MID Foden Everton - Sheffield Utd - Newcastle
16.1 132.0 127 0.1 Liverpool MID Salah Arsenal - Burnley - Newcastle
15.8 57.0 50 -0.5 Nott'm Forest MID Gibbs-White Bournemouth - Newcastle - Man Utd
14.7 50.0 42 -0.2 Fulham MID J.Palhinha Burnley - Bournemouth - Arsenal
X 31.1 43.0 22 -0.2 Fulham DEF Tosin Burnley - Bournemouth - Arsenal
X 20.6 44.0 45 -0.1 Bournemouth DEF Senesi Nott'm Forest - Fulham - Spurs
X 18.2 82.0 75 0.1 Liverpool DEF Alexander-Arnold Arsenal - Burnley - Newcastle
X 17.9 44.0 38 -0.5 Nott'm Forest DEF Toffolo Bournemouth - Newcastle - Man Utd
X 17.9 44.0 23 0.2 Aston Villa DEF Diego Carlos Sheffield Utd - Man Utd - Burnley
X 16.1 46.0 57 -0.1 Bournemouth GKP Neto Nott'm Forest - Fulham - Spurs
15.9 55.0 46 0.9 Man City GKP Ederson M. Everton - Sheffield Utd - Newcastle
Price: 99.7 Size: 15
LxP: 215.2 SxP: 278.0 CxP: 351.6
Schedule score: 15 Team score: 14 TSscore: 20.52
BIS xP Price TP UD Team Position Player Upcoming News
X 20.9 57.0 65 -0.2 Wolves FWD Cunha Chelsea - Brentford - Everton
X 19.7 76.0 58 0.6 Newcastle FWD Isak Luton - Nott'm Forest - Liverpool
X 17.5 139.0 112 0.9 Man City FWD Haaland Everton - Sheffield Utd - Newcastle Foot injury - 50% chance of playing
X 18.4 49.0 36 -0.2 Fulham MID Cairney Burnley - Bournemouth - Arsenal
X 16.9 76.0 71 0.9 Man City MID Foden Everton - Sheffield Utd - Newcastle
16.1 132.0 127 0.1 Liverpool MID Salah Arsenal - Burnley - Newcastle
15.8 57.0 50 -0.5 Nott'm Forest MID Gibbs-White Bournemouth - Newcastle - Man Utd
15.0 53.0 59 -0.2 Fulham MID Andreas Burnley - Bournemouth - Arsenal
X 31.1 43.0 22 -0.2 Fulham DEF Tosin Burnley - Bournemouth - Arsenal
X 20.6 44.0 45 -0.1 Bournemouth DEF Senesi Nott'm Forest - Fulham - Spurs
X 18.2 82.0 75 0.1 Liverpool DEF Alexander-Arnold Arsenal - Burnley - Newcastle
X 17.9 44.0 38 -0.5 Nott'm Forest DEF Toffolo Bournemouth - Newcastle - Man Utd
X 17.9 44.0 23 0.2 Aston Villa DEF Diego Carlos Sheffield Utd - Man Utd - Burnley
X 16.1 46.0 57 -0.1 Bournemouth GKP Neto Nott'm Forest - Fulham - Spurs
15.9 55.0 46 0.9 Man City GKP Ederson M. Everton - Sheffield Utd - Newcastle
```
## Acknowledgments
Special thanks to the maintainers of the [Fantasy-Premier-League](https://github.com/vaastav/Fantasy-Premier-League) library. This invaluable resource has been instrumental in providing comprehensive and up-to-date FPL player statistics, game-week specific data, and historical performance records. Their dedication to maintaining and updating this library plays a crucial role in enhancing the capabilities of our "Fantasy Premier League Team Optimizer" and the FPL community at large. Your efforts are greatly appreciated!
Raw data
{
"_id": null,
"home_page": null,
"name": "lazyfpl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "FPL, data analysis, fantasy premier league, football data, machine learning, python, soccer statistics, sports analytics, team optimization",
"author": null,
"author_email": "JB Lovland <janbjorge@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/f7/3a/da7425858f591c750ce71fd1dc614e25087c47bc97a62a0337a81f298f10/lazyfpl-0.4.0.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <a href=\"https://pypi.python.org/pypi/lazyfpl\"><img src=\"https://github.com/janbjorge/lazyFPL/blob/main/logo.png?raw=true\" alt=\"lazyFPL\"></a>\n</p>\n\n<p align=\"center\">\n <em>Fantasy Premier League Team Optimizer - Win at FPL with Laziness</em>\n</p>\n\n<p align=\"center\">\n<a href=\"https://github.com/astral-sh/ruff\" target=\"_blank\">\n <img src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\" alt=\"Package version\">\n</a>\n<a href=\"https://pypi.python.org/pypi/lazyfpl\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/v/lazyfpl.svg\" alt=\"Package version\">\n</a>\n<a href=\"https://pypi.python.org/pypi/lazyfpl\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/pyversions/lazyfpl.svg\" alt=\"Package version\">\n</a>\n<a href=\"https://pypi.python.org/pypi/lazyfpl\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/l/lazyfpl.svg\" alt=\"Supported Python versions\">\n</a>\n</p>\n\n#\nThe _Fantasy Premier League Team Optimizer_ employs data-driven methods for analyzing and optimizing Fantasy Premier League (FPL) team selections. It is an essential tool for FPL players who wish to leverage statistical models and optimization algorithms for a competitive advantage.\n\n## Why Model Training is Essential\nIn this application, training a machine learning model is critical as it allows for nuanced understanding and prediction of FPL player performances. By analyzing historical data, the model identifies patterns and trends, offering forecasts about future player performances. These predictions are invaluable for strategic team selection and transfer decisions, providing users with a significant edge in the game.\n\n## Modules Overview\n\n### `backevel`\nThe `backevel` module is designed to validate the accuracy of the model's predictions against real-world player performances. It serves as a critical tool for assessing the model's effectiveness, enabling users to understand and improve the predictive capability of the system. This module is especially useful for refining the model's algorithms to enhance its future forecasting accuracy.\n\n### `conf`\nThe `conf` module is where users can customize the application's settings and parameters. This flexibility allows for personalization according to individual strategies and preferences. It's crucial for users who want to adapt the application's functionality to their unique play style or specific requirements in the FPL.\n\n### `ml_model`\nThe `ml_model` module is at the core of the application. It uses machine learning algorithms to analyze historical data and predict future player performances. This predictive capability is what makes the application so powerful for FPL players, offering insights that can inform strategic decisions for team selections and transfers.\n\n### `optimizer`\nThe `optimizer` module combines the insights from the `ml_model` with the constraints defined by the user to suggest the best possible team setups. It is a sophisticated tool that leverages both data-driven predictions and user-defined strategies to maximize the performance of an FPL team.\n\n### `populator`\nThe `populator` module is responsible for filling the database with data from external sources. This module ensures that the database has comprehensive and up-to-date information, which is crucial for the accuracy of the model's predictions and the effectiveness of the optimizer.\n\n### `transfer`\nIn the `transfer` module, users receive guidance on managing player transfers, influenced by the model's predictions and optimization algorithms. This module helps users make informed decisions about player transfers, combining data-driven insights with strategic planning for improved team performance.\n\n## `differentials`\nThe differentials module is a specialized tool designed for the Fantasy Premier League Team Optimizer. It offers analytics to identify potential differential picks in your fantasy football team. Differential picks are players who are not widely selected by other managers but have the potential to score high points, thereby giving you an edge in the competition.\n\n## Command Line Interface (CLI) Usage\nThis application features a CLI, implemented via `argparse`, for straightforward interaction and execution. Below are command examples for key operations:\n\n```bash\n# Builds local player database.\npython3 -m lazyfpl.populator\n\n# Train ml-model (used to estimate expected points per player).\npython3 -m lazyfpl.ml_model\n\n# Backeval the model (optional).\npython3 -m lazyfpl.backevel\n\n# Optimize team selection based on various criteria.\npython3 -m lazyfpl.optimizer --no-news --min-mtm 60\n```\n\nObs! Step 1 and 2 must be run every gameweek to optain any new data.\n\n\n## optimizer\nSummary of lazyfpl.optimizer Command Output\n\nThe lazyfpl.optimizer command, with the parameters --no-news --min-mtm 60 --include Salah Haaland Alexander-Arnold, generated several team combinations for the Fantasy Premier League, focusing on optimizing the team with specific constraints and player inclusions.\n\n- Key Players Included: The optimization specifically included Mohamed Salah, Erling Haaland, and Trent Alexander-Arnold, key players known for their high impact in FPL.\n- Player Analysis: The output provided detailed analytics on various players, including expected points (xP), price, total points (TP), and upcoming matches. Notably, Erling Haaland was mentioned with a foot injury and a 50% chance of playing.\n- Team Statistics: The command calculated different metrics like 'Price', 'Size', 'LxP' (Likely points), 'SxP' (Scheduled points), and 'CxP' (Combined points), providing a comprehensive overview of the team's potential performance.\n- Optimization Results: The optimizer assessed numerous combinations of goalkeepers, defenders, midfielders, and forwards, totaling an astronomical number of potential team setups (in the range of 4.4e+15).\n- Team Performance Scores: The summary includes schedule scores, team scores, and total scores (TSscore), indicating the balance between the team's schedule, individual player performance, and overall team synergy.\n\nThis summary provides a snapshot of the optimizer's output, showcasing its capabilities in assessing player performances, predicting future outputs, and suggesting optimal team configurations based on the given parameters\n\n```python\nPrice: 99.4 Size: 15\nLxP: 215.2 SxP: 277.7 CxP: 351.3\nSchedule score: 15 Team score: 14 TSscore: 20.52\nBIS xP Price TP UD Team Position Player Upcoming News\nX 20.9 57.0 65 -0.2 Wolves FWD Cunha Chelsea - Brentford - Everton \nX 19.7 76.0 58 0.6 Newcastle FWD Isak Luton - Nott'm Forest - Liverpool \nX 17.5 139.0 112 0.9 Man City FWD Haaland Everton - Sheffield Utd - Newcastle Foot injury - 50% chance of playing\nX 18.4 49.0 36 -0.2 Fulham MID Cairney Burnley - Bournemouth - Arsenal \nX 16.9 76.0 71 0.9 Man City MID Foden Everton - Sheffield Utd - Newcastle \n 16.1 132.0 127 0.1 Liverpool MID Salah Arsenal - Burnley - Newcastle \n 15.8 57.0 50 -0.5 Nott'm Forest MID Gibbs-White Bournemouth - Newcastle - Man Utd \n 14.7 50.0 42 -0.2 Fulham MID J.Palhinha Burnley - Bournemouth - Arsenal \nX 31.1 43.0 22 -0.2 Fulham DEF Tosin Burnley - Bournemouth - Arsenal \nX 20.6 44.0 45 -0.1 Bournemouth DEF Senesi Nott'm Forest - Fulham - Spurs \nX 18.2 82.0 75 0.1 Liverpool DEF Alexander-Arnold Arsenal - Burnley - Newcastle \nX 17.9 44.0 38 -0.5 Nott'm Forest DEF Toffolo Bournemouth - Newcastle - Man Utd \nX 17.9 44.0 23 0.2 Aston Villa DEF Diego Carlos Sheffield Utd - Man Utd - Burnley \nX 16.1 46.0 57 -0.1 Bournemouth GKP Neto Nott'm Forest - Fulham - Spurs \n 15.9 55.0 46 0.9 Man City GKP Ederson M. Everton - Sheffield Utd - Newcastle \n\nPrice: 99.7 Size: 15\nLxP: 215.2 SxP: 278.0 CxP: 351.6\nSchedule score: 15 Team score: 14 TSscore: 20.52\nBIS xP Price TP UD Team Position Player Upcoming News\nX 20.9 57.0 65 -0.2 Wolves FWD Cunha Chelsea - Brentford - Everton \nX 19.7 76.0 58 0.6 Newcastle FWD Isak Luton - Nott'm Forest - Liverpool \nX 17.5 139.0 112 0.9 Man City FWD Haaland Everton - Sheffield Utd - Newcastle Foot injury - 50% chance of playing\nX 18.4 49.0 36 -0.2 Fulham MID Cairney Burnley - Bournemouth - Arsenal \nX 16.9 76.0 71 0.9 Man City MID Foden Everton - Sheffield Utd - Newcastle \n 16.1 132.0 127 0.1 Liverpool MID Salah Arsenal - Burnley - Newcastle \n 15.8 57.0 50 -0.5 Nott'm Forest MID Gibbs-White Bournemouth - Newcastle - Man Utd \n 15.0 53.0 59 -0.2 Fulham MID Andreas Burnley - Bournemouth - Arsenal \nX 31.1 43.0 22 -0.2 Fulham DEF Tosin Burnley - Bournemouth - Arsenal \nX 20.6 44.0 45 -0.1 Bournemouth DEF Senesi Nott'm Forest - Fulham - Spurs \nX 18.2 82.0 75 0.1 Liverpool DEF Alexander-Arnold Arsenal - Burnley - Newcastle \nX 17.9 44.0 38 -0.5 Nott'm Forest DEF Toffolo Bournemouth - Newcastle - Man Utd \nX 17.9 44.0 23 0.2 Aston Villa DEF Diego Carlos Sheffield Utd - Man Utd - Burnley \nX 16.1 46.0 57 -0.1 Bournemouth GKP Neto Nott'm Forest - Fulham - Spurs \n 15.9 55.0 46 0.9 Man City GKP Ederson M. Everton - Sheffield Utd - Newcastle \n```\n\n## Acknowledgments\n\nSpecial thanks to the maintainers of the [Fantasy-Premier-League](https://github.com/vaastav/Fantasy-Premier-League) library. This invaluable resource has been instrumental in providing comprehensive and up-to-date FPL player statistics, game-week specific data, and historical performance records. Their dedication to maintaining and updating this library plays a crucial role in enhancing the capabilities of our \"Fantasy Premier League Team Optimizer\" and the FPL community at large. Your efforts are greatly appreciated!",
"bugtrack_url": null,
"license": "MIT",
"summary": "Fantasy Premier League Team Optimizer - Win at FPL with lazines",
"version": "0.4.0",
"project_urls": null,
"split_keywords": [
"fpl",
" data analysis",
" fantasy premier league",
" football data",
" machine learning",
" python",
" soccer statistics",
" sports analytics",
" team optimization"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "81364c38b334b9a3001836d6a0ec934df93343c8bf809e73952fc6c2bf809a56",
"md5": "5b501df0ad76e694ba6febcceb0ae5ec",
"sha256": "bd0833186930f29ac4341a78fc7f9ce45d8b17cbc3d1dd3dd5632c8169b7c7ef"
},
"downloads": -1,
"filename": "lazyfpl-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5b501df0ad76e694ba6febcceb0ae5ec",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 28504,
"upload_time": "2024-11-08T23:41:32",
"upload_time_iso_8601": "2024-11-08T23:41:32.177091Z",
"url": "https://files.pythonhosted.org/packages/81/36/4c38b334b9a3001836d6a0ec934df93343c8bf809e73952fc6c2bf809a56/lazyfpl-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f73ada7425858f591c750ce71fd1dc614e25087c47bc97a62a0337a81f298f10",
"md5": "701b2a950196273389b982d143751503",
"sha256": "9429c41c2f429ce561bf6adc12be63fb13b57d4b1a796b304eccb6c023c0195d"
},
"downloads": -1,
"filename": "lazyfpl-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "701b2a950196273389b982d143751503",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 380255,
"upload_time": "2024-11-08T23:41:34",
"upload_time_iso_8601": "2024-11-08T23:41:34.422502Z",
"url": "https://files.pythonhosted.org/packages/f7/3a/da7425858f591c750ce71fd1dc614e25087c47bc97a62a0337a81f298f10/lazyfpl-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-08 23:41:34",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lazyfpl"
}