{"id":19840971,"url":"https://github.com/torvaney/fpl-optimiser","last_synced_at":"2025-07-15T07:37:24.919Z","repository":{"id":133824081,"uuid":"95472689","full_name":"Torvaney/fpl-optimiser","owner":"Torvaney","description":"Optimise FPL squads","archived":false,"fork":false,"pushed_at":"2019-04-16T16:41:23.000Z","size":8,"stargazers_count":58,"open_issues_count":1,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-01T19:38:56.397Z","etag":null,"topics":["fantasy-premier-league","kooky-projects","linear-programming"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Torvaney.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-26T17:41:33.000Z","updated_at":"2025-02-15T22:00:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"2bf5acf7-b206-4cff-8a47-0e26bf7c8eed","html_url":"https://github.com/Torvaney/fpl-optimiser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Torvaney/fpl-optimiser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torvaney%2Ffpl-optimiser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torvaney%2Ffpl-optimiser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torvaney%2Ffpl-optimiser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torvaney%2Ffpl-optimiser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Torvaney","download_url":"https://codeload.github.com/Torvaney/fpl-optimiser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torvaney%2Ffpl-optimiser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265418482,"owners_count":23761817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fantasy-premier-league","kooky-projects","linear-programming"],"created_at":"2024-11-12T12:28:53.095Z","updated_at":"2025-07-15T07:37:24.894Z","avatar_url":"https://github.com/Torvaney.png","language":"Python","readme":"# FPL optimiser\n\nUse linear programming to find the optimal fantasy football (soccer) squad.\n\nThis is not my idea and was originally (to my knowledge) by Martin Eastwood. You can find his blog post here: http://www.pena.lt/y/2014/07/24/mathematically-optimising-fantasy-football-teams/\n\nThe code was written on python 3.5.\n\n## How to use it\n\nThis repo contains two main modules. `fetch_fpl_history` downloads the data from the fpl website. `optimise` allows you to find the optimal squad for a given season.\n\nUsage is pretty simple. Just run the following two commands from the command line:\n```\n\u003e python fetch_fpl_history.py\n\u003e python optimise.py\n```\n\nThis will output an optimised squad, like the example below:\n```\nPosition               Name  Cost  Points\nGoalkeeper         Tom Heaton   5.0   149.0\nGoalkeeper     Fraser Forster   5.0   134.0\n  Defender    Charlie Daniels   5.0   134.0\n  Defender  César Azpilicueta   6.5   170.0\n  Defender        Gary Cahill   6.5   178.0\n  Defender      Marcos Alonso   7.0   177.0\n  Defender     Gareth McAuley   5.0   131.0\nMidfielder          Joe Allen   5.5   118.0\nMidfielder  Christian Eriksen   9.5   218.0\nMidfielder      Bamidele Alli   9.5   225.0\nMidfielder     Etienne Capoue   5.5   131.0\nMidfielder   Robert Snodgrass   6.0   133.0\n   Forward        Joshua King   7.5   178.0\n   Forward      Jermain Defoe   8.0   166.0\n   Forward    Roberto Firmino   8.5   180.0\n\nTotal cost:     100.0\nTotal points:   2422.0\nFormation:      2-5-5-3\n```\n\n## Notes\n\nSome notes on each of the modules\n\n#### `fetch_fpl_history`\n\n`fetch_fpl_history` fetches the data from the FPL website and saves it to `data/fpl_history.csv`.\n\nThis file includes a call to `time.sleep` so that we don't overload the FPL website's servers. Please bear this in mind and when scraping.\n\n#### `optimise`\n\nOnce you have downloaded the data, you can run `python optimise.py` from the command line to find the optimal squad.\n\nYou can optionally change the optimiser's constraints with some command line arguments. For instance, if you wanted to run the optimiser with a different budget to the default £100, you can run `python optimise.py --budget 105`.\n\nAnother option is to supply a different formation to the default 2-5-5-3. For example if you wanted to optimise the first XI players (replacing the remaining squad places with £4.0 players), you could try `python optimise.py --formation 1-4-4-2` or `python optimise.py --formation 1-3-4-3`.\n\nOr perhaps you've already decided which star striker (£10) you'll put in your team and want to optimise the rest of the squad `python optimise.py --formation 2-5-5-2 --budget 90`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorvaney%2Ffpl-optimiser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorvaney%2Ffpl-optimiser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorvaney%2Ffpl-optimiser/lists"}