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

in #fpl6 years ago






https://github.com/amosbastian/fpl

What is fpl?

It's a Python wrapper for the Fantasy Premier League, 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).


About a week ago 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 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

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

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

Installing from GitHub



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

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

Using the FPL class



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



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

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 …



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



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?!



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

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

This part contains everything related to contributing to fpl.

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 [email protected] <mailto:[email protected]>_.
  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

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

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

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

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!

Sort:  

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, 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.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @ms10398! Keep up the good work!

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 to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

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.

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!

Have a nice day and sincerely yours,
trufflepig
TrufflePig

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 or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.24
TRX 0.25
JST 0.039
BTC 96247.25
ETH 3349.36
USDT 1.00
SBD 3.28