<center> <br> <b>fpl</b> <br> A Python wrapper around the Fantasy Premier League API. </center> #### Repository https://github.com/amosbastian/fpl #### Pull request https://github.com/amosbastian/fpl/pull/11 #### Installation and upgrading ``` # installation pip install fpl # upgrading pip install fpl --upgrade ``` --- ``` Usage: fpl [OPTIONS] COMMAND [ARGS]... Options: --help Show this message and exit. Commands: myteam Echoes a logged in user's team to the terminal. picks Echoes a user's picks to the terminal. ``` One of the items in my roadmap for fpl was adding a CLI, so I decided to start implementing that. It includes two commands so far, `myteam` and `picks`, which show a user's team and picks respectively. ANSI colour codes are used to colour the players depending on their status, and PTable is used to format some additional information in an aesthetically pleasing way. ## The `myteam` command As mentioned in my previous post, to see a user's current team, you need to be logged in as the user (otherwise people could just copy your team). So, this command echoes a user's team to the terminal, which also includes additional information about a user's overall performance, after the user has logged in. If a wrong email address or password is entered this is shown as an error, and if a user has the FPL_EMAIL and FPL_PASSWORD environment variables set then they don't need to log in. #### Using email address and password <center></center> #### Wrong email address / password <center></center> #### With environment variables <center></center> ## The `picks` command This command echoes a user's picks to the terminal, which includes additional information about their performance in the current gameweek. It does not require the user to be logged in to see this information, so you can enter any user's ID that you want to. In comparison to the `myteam` command it shows the points scored by each player in the current gameweek. <center></center> --- ## Small fix Yesterday someone created [an issue](https://github.com/amosbastian/fpl/issues/10) about a failure to import module(s). In this update this has hopefully also been fixed (it works for me), but I am waiting to hear back from him to confirm this is also the case for him. --- ### CLI roadmap I have a couple of commands / things I want to add to the CLI: * A way to add an account locally, similar to `beempy importaccount` * Favouriting users, since it's a hassle to type in a user's ID, and there is seemingly no way to map an email address to a user ID using their API * A command that streams information about your team / all the players currently playing if the gameweek is live If you have any thoughts about this please let me know. Especially ideas for new commands or suggestions to improve existing ones are very much appreciated!
author | amosbastian | ||||||
---|---|---|---|---|---|---|---|
permlink | releasing-fpl-0-5-2-adding-a-cli | ||||||
category | fpl | ||||||
json_metadata | {"community":"steempeak","app":"steempeak","format":"markdown","tags":["fpl","utopian-io","development","python","football"],"links":["https://github.com/amosbastian/fpl","https://github.com/amosbastian/fpl/pull/11","https://github.com/amosbastian/fpl/issues/10"],"image":["https://cdn.steemitimages.com/DQmct1Fn9wFPms4zL6uzti3x5Bc9rCBfGxPZPzEXwVgiE8A/image.png","https://cdn.steemitimages.com/DQmZ1DJ1iXfXcCpnPuzrh7KPVHF2UymvWpnxV2Li9Fa7JwC/fpl_myteam_login.gif","https://cdn.steemitimages.com/DQmPP6Wu3sPgQwNYQprSgxtUnTAmqAP6bALSLyChT4kZdcz/fpl_myteam_login_validation.gif","https://cdn.steemitimages.com/DQmXyAYMCQAo3iuwAzwF4AVgtPpxNadfcrKAnzz4twftgiE/fpl_myteam_no_login.gif","https://cdn.steemitimages.com/DQmPd7SDTpHYmFyZqxc3HsjMGK1CgMeTzLRceBEGUrrAtdc/fpl_picks.gif"]} | ||||||
created | 2018-10-04 16:00:12 | ||||||
last_update | 2018-10-04 16:00:12 | ||||||
depth | 0 | ||||||
children | 7 | ||||||
last_payout | 2018-10-11 16:00:12 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 105.526 HBD | ||||||
curator_payout_value | 33.958 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 3,462 | ||||||
author_reputation | 174,473,586,900,705 | ||||||
root_title | "Releasing fpl 0.5.2 - Adding a CLI" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 72,623,400 | ||||||
net_rshares | 85,073,502,984,519 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
acidyo | 0 | 3,972,218,535,589 | 30% | ||
azizbd | 0 | 23,468,227,615 | 18.2% | ||
sambillingham | 0 | 14,248,358,833 | 100% | ||
jamzed | 0 | 35,009,542,158 | 100% | ||
miniature-tiger | 0 | 65,594,850,794 | 50% | ||
dailygiveaway | 0 | 355,489,311 | 67% | ||
roxane | 0 | 20,527,480,925 | 1% | ||
doughtaker | 0 | 14,262,294,805 | 50% | ||
codingdefined | 0 | 3,199,192,435 | 4% | ||
dreamarif | 0 | 1,098,885,307 | 91% | ||
syedumair | 0 | 90,132,999,815 | 100% | ||
ingdirect | 0 | 270,118,823 | 53% | ||
abcbullion | 0 | 502,452,345 | 45% | ||
steemstatistics | 0 | 312,064,506 | 60% | ||
espoem | 0 | 52,547,981,020 | 49% | ||
loshcat | 0 | 3,018,124,612 | 100% | ||
katamori | 0 | 5,610,182,571 | 100% | ||
utopian-io | 0 | 79,538,105,370,091 | 54.92% | ||
shammi | 0 | 1,965,600,734 | 45.5% | ||
favcau | 0 | 30,085,781,798 | 50% | ||
steemtaker | 0 | 37,975,821,515 | 91% | ||
ayasha | 0 | 35,724,544,646 | 80% | ||
jahedkhan | 0 | 3,083,383,947 | 45.5% | ||
greenorange | 0 | 581,023,080 | 100% | ||
amosbastian | 0 | 69,013,567,622 | 74% | ||
grzesiekb | 0 | 142,772,768,429 | 100% | ||
tobias-g | 0 | 131,951,607,118 | 100% | ||
andeladenaro | 0 | 4,536,519,956 | 100% | ||
ggabogarcia | 0 | 17,085,810,261 | 100% | ||
reazuliqbal | 0 | 21,832,237,790 | 35% | ||
zcool | 0 | 184,679,676 | 10% | ||
melaffection | 0 | 1,723,763,270 | 100% | ||
codebull | 0 | 372,546,485 | 91% | ||
mhossain | 0 | 961,628,143 | 91% | ||
sheikhsayem | 0 | 1,716,708,319 | 100% | ||
beetlevc | 0 | 1,118,596,125 | 2% | ||
linco | 0 | 24,994,935,358 | 80% | ||
remind-me | 0 | 117,233,426 | 100% | ||
zayedsakib | 0 | 19,338,041,929 | 100% | ||
ceruleanblue | 0 | 4,942,847,293 | 100% | ||
heger | 0 | 335,714,732 | 100% | ||
priyanarc | 0 | 807,475,529 | 91% | ||
steem-ua | 0 | 646,841,656,396 | 4% | ||
alvinvoo | 0 | 932,125,673 | 100% | ||
nfc | 0 | 29,415,821,586 | 3% | ||
rigmelendez3 | 0 | 251,205,552 | 100% | ||
mrcheisen | 0 | 457,456,777 | 100% | ||
curbot | 0 | 1,899,729,799 | 5% |
Hello there, > Yesterday someone created an issue about a failure to import module(s). In this update this has hopefully also been fixed (it works for me), but I am waiting to hear back from him to confirm this is also the case for him. Sadly, I still have the same error on a fresh python3.6 virtual environment install from pypi on the latest version. After further review, I believe the problem is on the ```setup.py```. Looks like the ```packages``` field in the setup() needs also ```fpl.models```. It should be: ```packages=["fpl", "fpl.models"]```. This happened to me a couple of times in the past, the best way to avoid this, using [find_packages](https://setuptools.readthedocs.io/en/latest/setuptools.html#using-find-packages) instead of hard coding package names. *** Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category. To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/2221211). ---- Need help? Write a ticket on https://support.utopian.io/. Chat with us on [Discord](https://discord.gg/uTyJkNm). [[utopian-moderator]](https://join.utopian.io/)
author | emrebeyler |
---|---|
permlink | re-amosbastian-releasing-fpl-0-5-2-adding-a-cli-20181004t220314640z |
category | fpl |
json_metadata | {"tags":["fpl"],"links":["https://setuptools.readthedocs.io/en/latest/setuptools.html#using-find-packages","https://join.utopian.io/guidelines","https://review.utopian.io/result/3/2221211","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"} |
created | 2018-10-04 22:03:15 |
last_update | 2018-10-04 22:05:33 |
depth | 1 |
children | 1 |
last_payout | 2018-10-11 22:03:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 6.489 HBD |
curator_payout_value | 2.079 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,275 |
author_reputation | 448,535,049,068,622 |
root_title | "Releasing fpl 0.5.2 - Adding a CLI" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 72,639,972 |
net_rshares | 5,056,432,683,973 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
yuxi | 0 | 8,721,745,261 | 30% | ||
codingdefined | 0 | 8,066,848,221 | 10% | ||
utopian-io | 0 | 4,982,551,811,570 | 3.45% | ||
zapncrap | 0 | 1,969,087,650 | 5% | ||
amosbastian | 0 | 6,417,895,299 | 7.15% | ||
curx | 0 | 1,792,128,608 | 5% | ||
oups | 0 | 1,401,696,661 | 3% | ||
reazuliqbal | 0 | 6,168,546,871 | 10% | ||
hakancelik | 0 | 10,365,770,321 | 30% | ||
mightypanda | 0 | 27,078,290,633 | 25% | ||
fastandcurious | 0 | 1,898,862,878 | 50% |
Thank you for your review, @emrebeyler! So far this week you've reviewed 1 contributions. Keep up the good work!
author | utopian-io |
---|---|
permlink | re-re-amosbastian-releasing-fpl-0-5-2-adding-a-cli-20181004t220314640z-20181008t015538z |
category | fpl |
json_metadata | "{"app": "beem/0.20.1"}" |
created | 2018-10-08 01:55:39 |
last_update | 2018-10-08 01:55:39 |
depth | 2 |
children | 0 |
last_payout | 2018-10-15 01:55:39 |
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 | 113 |
author_reputation | 152,955,367,999,756 |
root_title | "Releasing fpl 0.5.2 - Adding a CLI" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 72,839,675 |
net_rshares | 0 |
#### Hi @amosbastian! Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation! Your post is eligible for our upvote, thanks to our collaboration with @utopian-io! **Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
author | steem-ua |
---|---|
permlink | re-releasing-fpl-0-5-2-adding-a-cli-20181005t085550z |
category | fpl |
json_metadata | "{"app": "beem/0.20.5"}" |
created | 2018-10-05 08:55:51 |
last_update | 2018-10-05 08:55:51 |
depth | 1 |
children | 0 |
last_payout | 2018-10-12 08:55:51 |
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 | 290 |
author_reputation | 23,214,230,978,060 |
root_title | "Releasing fpl 0.5.2 - Adding a CLI" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 72,667,361 |
net_rshares | 0 |
Hey, @amosbastian <p><strong>Thank you for your contribution </strong></p>So far you've submitted <strong>12</strong> contributions on Utopian. Keep up the good work! <p>Your <strong>12</strong> contributions have been appoved and upvoted by Utopian</p><p><strong>Here is your contributions details..</strong></p> <ul type='square'><li>Development : <strong>8</strong></li></ul> Your total payout for <strong>12</strong> contributions is <strong>$ 874.88</strong>
author | utopian-buddy |
---|---|
permlink | releasing-fpl-0-5-2-adding-a-cli-utopian-post-stats |
category | fpl |
json_metadata | {"tags":["utopian-io"],"app":"utopian-buddy"} |
created | 2018-10-04 16:04:09 |
last_update | 2018-10-04 16:04:09 |
depth | 1 |
children | 2 |
last_payout | 2018-10-11 16:04:09 |
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 | 465 |
author_reputation | 141,790,228 |
root_title | "Releasing fpl 0.5.2 - Adding a CLI" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 72,623,683 |
net_rshares | 5,498,249,590 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
katamori | 0 | 5,498,249,590 | 100% |
Hey, we have noticed your recent activity and it looks like you provide informative comments regarding the contributor's history. However, as this account is not associated with Utopian.io and accounts in Steem. Furthermore, to avoid any confusion, please consider not using the Utopian logo in your profile without permission. Nonetheless, the project looks interesting.
author | espoem |
---|---|
permlink | re-utopian-buddy-releasing-fpl-0-5-2-adding-a-cli-utopian-post-stats-20181004t164737270z |
category | fpl |
json_metadata | {"tags":["fpl"],"app":"steemit/0.1"} |
created | 2018-10-04 16:47:39 |
last_update | 2018-10-04 16:52:24 |
depth | 2 |
children | 1 |
last_payout | 2018-10-11 16:47:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.064 HBD |
curator_payout_value | 0.009 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 373 |
author_reputation | 59,289,149,412,912 |
root_title | "Releasing fpl 0.5.2 - Adding a CLI" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 72,625,937 |
net_rshares | 49,468,626,702 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
oups | 0 | 49,468,626,702 | 100% |
Hi @espoem Thanks for your suggestion and advise. Yes today itself this bot came into action as part of utopian contribution and i'm glad to be part of utopian.io, i will look into that. Till further approval i will be removing utopian logo. Thank you
author | utopian-buddy |
---|---|
permlink | re-espoem-re-utopian-buddy-releasing-fpl-0-5-2-adding-a-cli-utopian-post-stats-20181004t170102845z |
category | fpl |
json_metadata | {"tags":["fpl"],"users":["espoem"],"app":"steemit/0.1"} |
created | 2018-10-04 17:01:06 |
last_update | 2018-10-04 17:01:06 |
depth | 3 |
children | 0 |
last_payout | 2018-10-11 17:01: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 | 263 |
author_reputation | 141,790,228 |
root_title | "Releasing fpl 0.5.2 - Adding a CLI" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 72,626,571 |
net_rshares | 0 |
Hey, @amosbastian! **Thanks for contributing on Utopian**. Weβre already looking forward to your next contribution! **Get higher incentives and support Utopian.io!** Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via [SteemPlus](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)). **Want to chat? Join us on Discord https://discord.gg/h52nFrV.** <a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
author | utopian-io |
---|---|
permlink | re-releasing-fpl-0-5-2-adding-a-cli-20181007t045013z |
category | fpl |
json_metadata | "{"app": "beem/0.20.1"}" |
created | 2018-10-07 04:50:15 |
last_update | 2018-10-07 04:50:15 |
depth | 1 |
children | 0 |
last_payout | 2018-10-14 04:50:15 |
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 | 593 |
author_reputation | 152,955,367,999,756 |
root_title | "Releasing fpl 0.5.2 - Adding a CLI" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 72,782,621 |
net_rshares | 0 |