 I was browsing https://utopian.io/ earlier in the week and came across a great post by @emrebeyler where he [showcased his Python wrapper for the Utopian API](https://steemit.com/utopian-io/@emrebeyler/python-client-of-utopian-api) and this inspired me to make one for the Fantasy Premier League API! The Fantasy Premier League is a game, with more than five million users, in which users assemble their fantasy team consisting of real footballers and score points based on those players' performances in real life. The game is also huge on Steemit, with @acidyo and @arsenal49 doing great work! Personally I do a lot of programming in Python with the Fantasy Premier League API and have made this wrapper to make my life and other people's lives easier when doing this, as there surprisingly isn't already one (at least from what I could find). I've never done something like this before, so I've used @emrebeyler's API as a huge example for my first, basic version `0.2.0`. Installation ------------ ``` pip install fpl ``` Usage ----- ```python import fpl fpl = fpl.FPL() ``` Documentation ------------- * Get specific user ```python print(fpl.user("3523615")) ``` * Get specific user's history ```python print(fpl.user_history("3523615")) ``` * Get specific user's picks ```python print(fpl.user_picks("3523615")) ``` * Get specific user's cup information ```python print(fpl.user_cup("3523615")) ``` * Get specific user's transfers ```python print(fpl.user_transfers("3523615")) ``` * Get specific user's entered leagues ```python print(fpl.user_leagues_entered("3523615")) ``` * Get teams ```python print(fpl.teams) ``` * Get players ```python print(fpl.players) ``` * Get specific player ```python print(fpl.player("123")) ``` * Get gameweeks ```python print(fpl.gameweeks) ``` * Get specific gameweek ```python print(fpl.gameweek(20)) ``` * Get game settings ```python print(fpl.game_settings) ``` * Get specific classic league information ```python print(fpl.classic_league("743038")) ``` * Get specific h2h league information ```python print(fpl.h2h_league("28281")) ``` Tests ----- ``` $ python test.py .............. ---------------------------------------------------------------------- Ran 14 tests in 3.687s OK ``` Improvements ------------ In the future I will be looking at other Python wrappers like `PRAW` and `python-twitter` and improving my own wrapper to (hopefully) be of a similar quality as those two. <br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@amosbastian/python-wrapper-for-the-fantasy-premier-league-api">Utopian.io - Rewarding Open Source Contributors</a></em><hr/>
author | amosbastian | ||||||
---|---|---|---|---|---|---|---|
permlink | python-wrapper-for-the-fantasy-premier-league-api | ||||||
category | utopian-io | ||||||
json_metadata | {"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":116973478,"name":"python-fpl","full_name":"amosbastian/python-fpl","html_url":"https://github.com/amosbastian/python-fpl","fork":false,"owner":{"login":"amosbastian"}},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","python","steemdev","programming","sfpl"],"users":["emrebeyler","acidyo","arsenal49"],"links":["https://utopian.io/","https://steemit.com/utopian-io/@emrebeyler/python-client-of-utopian-api","https://utopian.io/utopian-io/@amosbastian/python-wrapper-for-the-fantasy-premier-league-api"],"image":["https://res.cloudinary.com/hpiynhbhq/image/upload/v1515687734/tiq5siblff0yfqp7zgxa.png"],"moderator":{"account":"ms10398","reviewed":true,"pending":false,"flagged":false}} | ||||||
created | 2018-01-11 16:20:09 | ||||||
last_update | 2018-01-13 12:20:30 | ||||||
depth | 0 | ||||||
children | 6 | ||||||
last_payout | 2018-01-18 16:20:09 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 88.728 HBD | ||||||
curator_payout_value | 38.463 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 2,743 | ||||||
author_reputation | 174,473,586,900,705 | ||||||
root_title | "Python wrapper for the Fantasy Premier League API" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 28,792,286 | ||||||
net_rshares | 19,731,028,515,673 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
juliank | 0 | 130,300,902,876 | 10% | ||
jznsamuel | 0 | 32,309,163,444 | 20% | ||
kvg | 0 | 596,068,672 | 100% | ||
codingdefined | 0 | 7,037,947,962 | 25% | ||
fabiyamada | 0 | 110,605,880,355 | 50% | ||
bobdos | 0 | 906,952,766 | 2% | ||
elear | 0 | 206,676,846,261 | 100% | ||
utopian-io | 0 | 19,192,381,652,054 | 12.89% | ||
jaff8 | 0 | 38,925,363,625 | 100% | ||
steemitstats | 0 | 2,051,822,768 | 5% | ||
arcjen02 | 0 | 1,477,062,587 | 100% | ||
amosbastian | 0 | 1,845,458,256 | 100% | ||
rondras | 0 | 0 | 1% | ||
steempytutorials | 0 | 242,236,427 | 100% | ||
b2travel | 0 | 0 | 100% | ||
alender | 0 | 387,076,589 | 100% | ||
chelsea.bear | 0 | 1,247,316,755 | 3% | ||
amos1969 | 0 | 541,516,934 | 100% | ||
xvz | 0 | 322,612,500 | 100% | ||
zsh | 0 | 479,310,000 | 100% | ||
claraquarius | 0 | 2,078,846,657 | 5% | ||
farben | 0 | 614,478,185 | 100% | ||
jpphoto | 0 | 0 | 55% | ||
ppss | 0 | 0 | 100% |
Thank you for the contribution. It has been approved. You can contact us on [Discord](https://discord.gg/UCvqCsx). **[[utopian-moderator]](https://utopian.io/moderators)**
author | ms10398 |
---|---|
permlink | re-amosbastian-python-wrapper-for-the-fantasy-premier-league-api-20180112t115002915z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"} |
created | 2018-01-12 11:50:03 |
last_update | 2018-01-12 11:50:03 |
depth | 1 |
children | 1 |
last_payout | 2018-01-19 11:50:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 172 |
author_reputation | 27,572,487,973,390 |
root_title | "Python wrapper for the Fantasy Premier League API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 28,985,812 |
net_rshares | 1,753,535,568 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
amosbastian | 0 | 1,753,535,568 | 100% |
Thanks!
author | amosbastian |
---|---|
permlink | re-ms10398-re-amosbastian-python-wrapper-for-the-fantasy-premier-league-api-20180112t140332290z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-01-12 14:03:30 |
last_update | 2018-01-12 14:03:30 |
depth | 2 |
children | 0 |
last_payout | 2018-01-19 14:03:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 7 |
author_reputation | 174,473,586,900,705 |
root_title | "Python wrapper for the Fantasy Premier League API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 29,010,936 |
net_rshares | 0 |
Great
author | nilesh.katuwal |
---|---|
permlink | re-amosbastian-python-wrapper-for-the-fantasy-premier-league-api-20180114t105942532z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-01-14 11:00:36 |
last_update | 2018-01-14 11:00:36 |
depth | 1 |
children | 0 |
last_payout | 2018-01-21 11:00:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 5 |
author_reputation | 115,572,923,739 |
root_title | "Python wrapper for the Fantasy Premier League API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 29,432,519 |
net_rshares | 0 |
### Hey @amosbastian I am @utopian-io. I have just upvoted you! #### Achievements - You have less than 500 followers. Just gave you a gift to help you succeed! - Seems like you contribute quite often. AMAZING! #### Community-Driven Witness! I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER! - <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a> - <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a> - Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a> [](https://steemit.com/~witnesses) **Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
author | utopian-io |
---|---|
permlink | re-amosbastian-python-wrapper-for-the-fantasy-premier-league-api-20180113t165318901z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"} |
created | 2018-01-13 16:53:18 |
last_update | 2018-01-13 16:53:18 |
depth | 1 |
children | 0 |
last_payout | 2018-01-20 16:53:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,087 |
author_reputation | 152,955,367,999,756 |
root_title | "Python wrapper for the Fantasy Premier League API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 29,269,344 |
net_rshares | 1,750,471,259 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
amosbastian | 0 | 1,750,471,259 | 100% |
Nice work
author | xvz |
---|---|
permlink | re-amosbastian-python-wrapper-for-the-fantasy-premier-league-api-20180113t171906554z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-01-13 17:19:06 |
last_update | 2018-01-13 17:19:06 |
depth | 1 |
children | 1 |
last_payout | 2018-01-20 17:19:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 9 |
author_reputation | 313,641,425,957 |
root_title | "Python wrapper for the Fantasy Premier League API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 29,274,546 |
net_rshares | 0 |
Thanks!
author | amosbastian |
---|---|
permlink | re-xvz-re-amosbastian-python-wrapper-for-the-fantasy-premier-league-api-20180113t172152076z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-01-13 17:21:54 |
last_update | 2018-01-13 17:21:54 |
depth | 2 |
children | 0 |
last_payout | 2018-01-20 17:21:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 7 |
author_reputation | 174,473,586,900,705 |
root_title | "Python wrapper for the Fantasy Premier League API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 29,275,087 |
net_rshares | 0 |