Update: fpl (0.6.1) now has a user guide and contribution guidelines!
fpl·@amosbastian·
0.000 HBDUpdate: fpl (0.6.1) now has a user guide and contribution guidelines!
<center>  <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>  </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>  </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>  </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>  </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>  </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>  </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!
👍 gregory.latinier, fego, steeming-hot, kalasuut, teamcr, garrettwallace, jacksartori, eforucom, bluesniper, pataty69, jamjamfood, waltrowth, amriakeytor, paigelbq02, samanthaq, enlighted, munhenhos, mosuffcurge, bhaski, tiagoferezin, grapininpe, kyliehpbro, zoe561, cemblispterla, wicatennewp, nieloagranca, supu, amosbastian, steemtank, ayay, merlin7, killerbot, kggymlife, stmpay, jaff8, shammi, gogreenbuddy, hamsa.quality, piaristmonk, sttest1, sttest2, dimitrisp, ajayyy, portugalcoin, zcool, snackaholic, tbtek, haiyangdeperci, roxane, postvoter, ceruleanblue, alvinvoo, filipino, magpielover, miniature-tiger, espoem, ascorphat, mops2e, boyanpro, clayjohn, blockchainstudio, tykee, steem-plus, trufflepig, jga, katamori, movement19, ojap02, tipu.curator, aotearoa, tolgahanuzun, tdre, jjay, ryuna.siege, favcau, steemseph, themarkymark, scienceangel, utopian-io, tombstone, fandy, triple-paradox,