create account

Update: fpl (0.6.1) now has a user guide and contribution guidelines! by amosbastian

View this thread on: hive.blogpeakd.comecency.com
· @amosbastian ·
$40.03
Update: fpl (0.6.1) now has a user guide and contribution guidelines!
<center>
![](https://i.imgur.com/ao1t2qN.png)
<br>
<sup>
https://github.com/amosbastian/fpl
</sup>
</center>

### What is **fpl**?

It's a Python wrapper for the [Fantasy Premier League](https://fantasy.premierleague.com/), which is a fantasy football game - "a game in which participants assemble an imaginary team of real life footballers and score points based on those players' actual statistical performance or their perceived contribution on the field of play. " At the time of writing this post there are more than 6 million teams entered, which includes loads of people on Steem who are participating in Steem's very own league (see [here](https://steemit.com/steem/@acidyo/steem-fantasy-premier-league-gameweek-22-review)).

---

[About a week ago](https://steemit.com/fpl/@amosbastian/update-fpl-s-0-6-1-class-documentation-is-now-up-to-date) I updated all of **fpl**'s class documentation. Since I want to start searching for contributors and get some more people using it, I've now also added a user guide (including quickstart and example sections) and contributing guidelines (including guidelines for code & documentation contributions, bug reports and feature requests).

The documentation is hosted and generated by [ReadTheDocs](https://readthedocs.org/) and can be found here: https://fpl.readthedocs.io/.

All updates made to the documentation can be found in this pull request: https://github.com/amosbastian/fpl/pull/21

## [User guide](https://fpl.readthedocs.io/en/latest/#the-user-guide)

This part of the documentation is mostly an introduction on how to use fpl and install it - including information for people newer to asyncio.

### [Installation](https://fpl.readthedocs.io/en/latest/user/installation.html)

Was already added in previous versions of the documentation, so the only new part of this page is detailed below.

#### [Installing from GitHub](https://fpl.readthedocs.io/en/latest/user/installation.html#installing-from-github)

<center>
![](https://cdn.steemitimages.com/DQmVRL82sK8uhMmgJLLiyNtniWCiYXcY73yhceYnqdQsLxB/image.png)
</center>

As I mentioned in my previous post, the documentation was heavily inspired by **requests**' documentation. While browsing its documentation I noticed they also included a section on how to install it directly from GitHub, so I've also added this!

### [Quickstart](https://fpl.readthedocs.io/en/latest/user/quickstart.html)

This page was added to make it a bit more easy for users to get started with using **fpl**!

#### [Using the FPL class](https://fpl.readthedocs.io/en/latest/user/quickstart.html#using-the-fpl-object)

<center>
![](https://cdn.steemitimages.com/DQmcuQiVqmWpgVtu9YMrwnP2AH5jpjMnZYj69V4TvDsRQx2/image.png)
</center>

The **FPL** class is the main way **fpl** interacts with Fantasy Premier League's API, so I've added an example showing how you'd create it. It also shows you how **aiohttp** and **asyncio** would be used.

#### [Authentication](https://fpl.readthedocs.io/en/latest/user/quickstart.html#authentication)

<center>
![](https://cdn.steemitimages.com/DQmPRE32iBFntgrjWHB8rtH1G26jdpxmPjidTsfFgA5wEDH/image.png)
</center>

Since some endpoints require authentication, and this might not be obvious from the get go, I decided to also add a section explaining this. It basically shows what happens when you don't log in, and how to use **fpl.login()**.

### [Examples](https://fpl.readthedocs.io/en/latest/user/examples.html)

When trying out other packages I always noticed how useful examples are to me. Sometimes I get stuck in the documentation, and a simple example showing how to do something will unlock something in my brain. Because of this I've decided to add some examples as well!

Of course I had to code all these examples myself (click each header to see the code snippet), so I have no doubt that there are improvements that could be made.

#### [The league’s best …](https://fpl.readthedocs.io/en/latest/user/examples.html#the-league-s-best)

<center>
![](https://cdn.steemitimages.com/DQmQQ15xXX7ZcuZ9RoNoqHqat4c85FMCrD3pWPHc8mpYLef/image.png)
</center>

This section shows the user how to create a table showing which players have the most goals + assists. As you can see, it's pretty simple to do using **fpl**!

#### [Alternative FDR](https://fpl.readthedocs.io/en/latest/user/examples.html#alternative-fdr)

<center>
![](https://cdn.steemitimages.com/DQmPADVLA9BXyKdVKTiBcngQHSf1ufcRhNBtF54twCbPZ9S/image.png)
</center>

As we (Fantasy Premier League players) all know, the official FDR used by the Fantasy Premier League is not the best. With this in mind the function **FDR()** was created, which returns a dictionary containing an alternative FDR based on points scored for / against teams! I've created an example showing how to use this to create a table showing each team's alternative FDR.

##### [Optimal captain choice?!](https://fpl.readthedocs.io/en/latest/user/examples.html#optimal-captain-choice)

<center>
![](https://cdn.steemitimages.com/DQmRyYG2KqFS8FvhDWJ1tRscXobHiSjTecmofp37D7Mt6Vr/image.png)
</center>

One of the most important aspects of the Fantasy Premier League is your captain choice each week. Of course, it’s very difficult to get this correct each week! Because of this, it’s quite interesting (or frustrating) to see what could’ve been. I thought it would be interesting to create an example showing users how they can create a table with their captain choice and top scorer of each gameweek (including the difference in points).

## [Contributor guide](https://fpl.readthedocs.io/en/latest/index.html#the-contributor-guide)

As I mentioned earlier I will be actively looking for contributors, and so it was important to add this guide. It includes simple sections for all kinds of contributions I could think of, so hopefully it will streamline the process once I actually find people!

### [Contributing](https://fpl.readthedocs.io/en/latest/contributing/contributing.html)

This part contains everything related to contributing to **fpl**.

#### [Code contributions](https://fpl.readthedocs.io/en/latest/contributing/contributing.html#code-contributions)

Among other things this section contains a checklist that I would like contributors to follow, as well as some information about the code style.

1. Fork the repository on GitHub.
2. Run the tests with `pytest tests/` to confirm they all pass on your system.
   If the tests fail, then try and find out why this is happening. If you aren't
   able to do this yourself, then don't hesitate to either create an issue on
   GitHub (see :ref:`reporting-bugs`), contact me on Discord or send an email
   to `amosbastian@gmail.com <mailto:amosbastian@gmail.com>`_.
3. Either create your feature and then write tests for it, or do this the other
   way around.
4. Run all tests again with with `pytest tests/` to confirm that everything
   still passes, including your newly added test(s).
5. Create a pull request for the main repository's ``master`` branch.

#### [Documentation contributions](https://fpl.readthedocs.io/en/latest/contributing/contributing.html#documentation-contributions)

I have no doubt that there are people out there that can improve the documentation I have written, so I have added some basic information (literally the same as that found in **requests**' documentation).

#### [Reporting bugs](https://fpl.readthedocs.io/en/latest/contributing/contributing.html#reporting-bugs)

I also have no doubt there are bugs in **fpl** that I have somehow missed. Of course I want to fix these, and so I've included a template I want contributors to use (inspired by Utopian's very own template).

```
#### Expected behaviour
What did you expect to happen?

#### Actual behaviour
What actually happened?

#### How to reproduce
When did it happen? Include a code snippet if possible!
```

#### [Feature requests](https://fpl.readthedocs.io/en/latest/contributing/contributing.html#feature-requests)

Currently **fpl** is in active development, so feature requests are more than welcome. I know lots of people over on Reddit have great ideas, but have probably never used GitHub, so hopefully with this they will be able to create some issues with feature requests.

### [Authors](https://fpl.readthedocs.io/en/latest/contributing/authors.html)

Apart from myself there has only been 1 other contributor, but hopefully this will change in the future. I think it's cool, and important, to recognise the authors, so I've added a separate page where they can include themselves if they want to.

---

Other than that, I've made some small fixes that aren't worth creating their own section for. I think the documentation is good enough for now, but this can change once people request more examples, or additional sections for example. One thing I do want to do is figure out how to add custom CSS, so I can make the page wider or hide the sidebar at certain widths for example. If anyone knows how you can do this, then please let me know!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 18 others
properties (23)
authoramosbastian
permlinkupdate-fpl-0-6-1-now-has-a-user-guide-and-contribution-guidelines
categoryfpl
json_metadata{"community":"steempeak","app":"steempeak/1.7.0","format":"markdown","tags":["fpl","utopian-io","documentation","opensource","football"],"users":["acidyo","amosbastian","gmail.com"],"links":["https://github.com/amosbastian/fpl","https://fantasy.premierleague.com/","https://steemit.com/steem/@acidyo/steem-fantasy-premier-league-gameweek-22-review","https://steemit.com/fpl/@amosbastian/update-fpl-s-0-6-1-class-documentation-is-now-up-to-date","https://readthedocs.org/","https://fpl.readthedocs.io/","https://github.com/amosbastian/fpl/pull/21","https://fpl.readthedocs.io/en/latest/#the-user-guide","https://fpl.readthedocs.io/en/latest/user/installation.html","https://fpl.readthedocs.io/en/latest/user/installation.html#installing-from-github"],"image":["https://i.imgur.com/ao1t2qN.png","https://cdn.steemitimages.com/DQmVRL82sK8uhMmgJLLiyNtniWCiYXcY73yhceYnqdQsLxB/image.png","https://cdn.steemitimages.com/DQmcuQiVqmWpgVtu9YMrwnP2AH5jpjMnZYj69V4TvDsRQx2/image.png","https://cdn.steemitimages.com/DQmPRE32iBFntgrjWHB8rtH1G26jdpxmPjidTsfFgA5wEDH/image.png","https://cdn.steemitimages.com/DQmQQ15xXX7ZcuZ9RoNoqHqat4c85FMCrD3pWPHc8mpYLef/image.png","https://cdn.steemitimages.com/DQmPADVLA9BXyKdVKTiBcngQHSf1ufcRhNBtF54twCbPZ9S/image.png","https://cdn.steemitimages.com/DQmRyYG2KqFS8FvhDWJ1tRscXobHiSjTecmofp37D7Mt6Vr/image.png"]}
created2019-01-29 20:00:21
last_update2019-01-29 20:00:21
depth0
children5
last_payout2019-02-05 20:00:21
cashout_time1969-12-31 23:59:59
total_payout_value30.266 HBD
curator_payout_value9.760 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length8,972
author_reputation174,473,586,900,705
root_title"Update: fpl (0.6.1) now has a user guide and contribution guidelines!"
beneficiaries
0.
accountutopian.pay
weight500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id79,125,371
net_rshares86,516,799,110,117
author_curate_reward""
vote details (82)
@ms10398 ·
$8.08
Hello @amosbastian,

The contribution adds great value to the project. Contributions guideline are an important part of any project.

This contribution qualifies as a staff pick for the documentation category.

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/4/2-2-2-1-1-1-2-).

---- 
Need help? Chat with us on [Discord](https://discord.gg/uTyJkNm).

[[utopian-moderator]](https://join.utopian.io/)
👍  , , , , , , , , , , , , , , , ,
properties (23)
authorms10398
permlinkre-amosbastian-update-fpl-0-6-1-now-has-a-user-guide-and-contribution-guidelines-20190201t043407723z
categoryfpl
json_metadata{"tags":["fpl"],"users":["amosbastian"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/4/2-2-2-1-1-1-2-","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2019-02-01 04:34:09
last_update2019-02-01 04:34:09
depth1
children1
last_payout2019-02-08 04:34:09
cashout_time1969-12-31 23:59:59
total_payout_value6.132 HBD
curator_payout_value1.948 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length659
author_reputation27,572,487,973,390
root_title"Update: fpl (0.6.1) now has a user guide and contribution guidelines!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id79,239,838
net_rshares16,671,669,086,483
author_curate_reward""
vote details (17)
@utopian-io ·
Thank you for your review, @ms10398! Keep up the good work!
properties (22)
authorutopian-io
permlinkre-re-amosbastian-update-fpl-0-6-1-now-has-a-user-guide-and-contribution-guidelines-20190201t043407723z-20190203t200050z
categoryfpl
json_metadata"{"app": "beem/0.20.17"}"
created2019-02-03 20:00:51
last_update2019-02-03 20:00:51
depth2
children0
last_payout2019-02-10 20:00:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length59
author_reputation152,955,367,999,756
root_title"Update: fpl (0.6.1) now has a user guide and contribution guidelines!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id79,354,319
net_rshares0
@steem-plus ·
SteemPlus upvote
Hi, @amosbastian!

You just got a **0.07%** upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in [here](https://steemit.com/@steem-plus) to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.
properties (22)
authorsteem-plus
permlinkupdate-fpl-0-6-1-now-has-a-user-guide-and-contribution-guidelines---vote-steemplus
categoryfpl
json_metadata{}
created2019-01-30 06:23:24
last_update2019-01-30 06:23:24
depth1
children0
last_payout2019-02-06 06:23:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length438
author_reputation247,952,188,232,400
root_title"Update: fpl (0.6.1) now has a user guide and contribution guidelines!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id79,148,503
net_rshares0
@trufflepig ·
**Congratulations!** Your post has been selected as a daily Steemit truffle! It is listed on **rank 2** of all contributions awarded today. You can find the [TOP DAILY TRUFFLE PICKS HERE.](https://steemit.com/@trufflepig/daily-truffle-picks-2019-01-30) 
    
I upvoted your contribution because to my mind your post is at least **8 SBD** worth and should receive **193 votes**. It's now up to the lovely Steemit community to make this come true.

I am `TrufflePig`, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, [you can find an explanation here!](https://steemit.com/steemit/@trufflepig/weekly-truffle-updates-2019-04)
    
Have a nice day and sincerely yours,
![trufflepig](https://raw.githubusercontent.com/SmokinCaterpillar/TrufflePig/master/img/trufflepig17_small.png)
*`TrufflePig`*
    
properties (22)
authortrufflepig
permlinkre-update-fpl-0-6-1-now-has-a-user-guide-and-contribution-guidelines-20190130t162913
categoryfpl
json_metadata""
created2019-01-30 16:29:15
last_update2019-01-30 16:29:15
depth1
children0
last_payout2019-02-06 16:29:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length883
author_reputation21,266,577,867,113
root_title"Update: fpl (0.6.1) now has a user guide and contribution guidelines!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id79,170,855
net_rshares0
@utopian-io ·
Hey, @amosbastian!

**Thanks for contributing on Utopian**.
Congratulations! Your contribution was Staff Picked to receive a maximum vote for the documentation category on Utopian for being of significant value to the project and the open source community.

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>
properties (22)
authorutopian-io
permlinkre-update-fpl-0-6-1-now-has-a-user-guide-and-contribution-guidelines-20190202t220822z
categoryfpl
json_metadata"{"app": "beem/0.20.17"}"
created2019-02-02 22:08:24
last_update2019-02-02 22:08:24
depth1
children0
last_payout2019-02-09 22:08:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length791
author_reputation152,955,367,999,756
root_title"Update: fpl (0.6.1) now has a user guide and contribution guidelines!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id79,316,645
net_rshares0