Update: fpl's (0.6.1) class documentation is now up to date!

in #fpl6 years ago







https://github.com/amosbastian/fpl

<h3>What is <code>fpl? <p dir="auto">It's a Python wrapper for the <a href="https://fantasy.premierleague.com/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">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 <a href="https://steemit.com/steem/@acidyo/steem-fantasy-premier-league-gameweek-22-review" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">here). <hr /> <p dir="auto">In <a href="https://steemit.com/fpl/@amosbastian/update-fpl-0-6-0-is-now-asynchronous" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">my last post I described how I updated <code>fpl to now use asynchronous requests instead of synchronous requests. Since I completely rewrote large parts of the package, this also meant all the documentation had to be updated. In this documentation update I've updated all the docstrings of all <code>fpl's classes and their respective functions, updated the documentation homepage and added some examples for each class. <p dir="auto">The documentation is hosted and generated by <a href="https://readthedocs.org/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">ReadTheDocs<span> and can be found here: <a href="https://fpl.readthedocs.io/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://fpl.readthedocs.io/. <p dir="auto"><span>All updates made to the documentation can be found in this pull request: <a href="https://github.com/amosbastian/fpl/pull/20" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/amosbastian/fpl/pull/20 <h3><a href="https://fpl.readthedocs.io/en/latest/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Index <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmW8BXoapDZ43Jik9vv62G5rcwYHjXX7TSwF1ZjicxUwg5/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmW8BXoapDZ43Jik9vv62G5rcwYHjXX7TSwF1ZjicxUwg5/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmW8BXoapDZ43Jik9vv62G5rcwYHjXX7TSwF1ZjicxUwg5/image.png 2x" /><br /> <p dir="auto">I've changed the theme and added the project's logo and some badges. It also now includes a simple example showing how you'd use <strong>fpl to get a player and print them with the new asynchronous version. Other than that there are three sections for the user guide (to be expanded soon), the class documentation / guide and the not yet created contributor guide. Especially the last one will be useful once I start actively seeking contributors, so expect to see an update for this soon! <p dir="auto">Each class includes a code snippet showing its basic usage. They also include links to their respective endpoints found in Fantasy Premier League's API for people who want to check out all available information themselves. Below I will include links to each class, and include a screenshot showing each class' constructor - of course there is much for documentation available, like for each class' respective functions, but I won't include that in the screenshots because otherwise they would get too big! <h3><a href="https://fpl.readthedocs.io/en/latest/classes/classic_league.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">ClassicLeague <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmdj9jNDvCjVLekRp7RmQenSkF89yr7rPsAvLkjsReRoer/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmdj9jNDvCjVLekRp7RmQenSkF89yr7rPsAvLkjsReRoer/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmdj9jNDvCjVLekRp7RmQenSkF89yr7rPsAvLkjsReRoer/image.png 2x" /><br /> <h3><a href="https://fpl.readthedocs.io/en/latest/classes/fixture.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Fixture <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmQ5LD94ZScNJZYWw7cnV8AZdHtNhkSCwG2wHum2DYnNGm/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmQ5LD94ZScNJZYWw7cnV8AZdHtNhkSCwG2wHum2DYnNGm/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmQ5LD94ZScNJZYWw7cnV8AZdHtNhkSCwG2wHum2DYnNGm/image.png 2x" /><br /> <h3><a href="https://fpl.readthedocs.io/en/latest/classes/fpl.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">FPL <p dir="auto">The <strong>FPL class is the main class used for interacting with Fantasy Premier League’s API. It requires a <strong>aiohttp.ClientSession for sending requests, so typical usage of the <strong>FPL class can look something like this: <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmPg4opmT7YSQ3rbrLB28kmLn7fXxFL1S4DHN6NL1wWhyU/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmPg4opmT7YSQ3rbrLB28kmLn7fXxFL1S4DHN6NL1wWhyU/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmPg4opmT7YSQ3rbrLB28kmLn7fXxFL1S4DHN6NL1wWhyU/image.png 2x" /><br /> <p dir="auto">Of course since it is the main class it also includes much more documentation. Each of its functions has quite extensive documentation, with some of them including examples of what they return (where I thought it was necessary). <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQme2JSVd4fNFoyeoFXDNy3AZMLQoRECaza763PVEETPGgV/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQme2JSVd4fNFoyeoFXDNy3AZMLQoRECaza763PVEETPGgV/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQme2JSVd4fNFoyeoFXDNy3AZMLQoRECaza763PVEETPGgV/image.png 2x" /><br /> <p dir="auto">Just like the classes themselves, each function includes the URLs of the endpoints that they send GET requests to - this should hopefully mean the documentation is much more understandable for users. <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmRf7SfK4CWCvELcpYzScfB3DbctuF1bwxaim2phKBjEgH/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmRf7SfK4CWCvELcpYzScfB3DbctuF1bwxaim2phKBjEgH/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmRf7SfK4CWCvELcpYzScfB3DbctuF1bwxaim2phKBjEgH/image.png 2x" /><br /> <h3><a href="https://fpl.readthedocs.io/en/latest/classes/gameweek.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Gameweek <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmeGCcPiXkYgkfYSK9thN91A7sq3mo2bRCJtkF4PRDu2z3/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmeGCcPiXkYgkfYSK9thN91A7sq3mo2bRCJtkF4PRDu2z3/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmeGCcPiXkYgkfYSK9thN91A7sq3mo2bRCJtkF4PRDu2z3/image.png 2x" /><br /> <h3><a href="https://fpl.readthedocs.io/en/latest/classes/h2h_league.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">H2HLeague <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmSJ4LhPzbW3wkpNADXtDCqQfdegZH6CXsjzA77TrGR1ow/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmSJ4LhPzbW3wkpNADXtDCqQfdegZH6CXsjzA77TrGR1ow/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmSJ4LhPzbW3wkpNADXtDCqQfdegZH6CXsjzA77TrGR1ow/image.png 2x" /><br /> <h3><a href="https://fpl.readthedocs.io/en/latest/classes/player.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Player <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmerVdTd66pa3xbSjZvbDiMSNdJWC5QXrjUjUGvZuWLnbA/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmerVdTd66pa3xbSjZvbDiMSNdJWC5QXrjUjUGvZuWLnbA/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmerVdTd66pa3xbSjZvbDiMSNdJWC5QXrjUjUGvZuWLnbA/image.png 2x" /><br /> <h3><a href="https://fpl.readthedocs.io/en/latest/classes/team.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Team <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmfNZ9M8zZ779zsTgZh3RWAuQB9QshqD9vevzoYdATA7LY/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmfNZ9M8zZ779zsTgZh3RWAuQB9QshqD9vevzoYdATA7LY/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmfNZ9M8zZ779zsTgZh3RWAuQB9QshqD9vevzoYdATA7LY/image.png 2x" /><br /> <h3><a href="https://fpl.readthedocs.io/en/latest/classes/user.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">User <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmQNwCQHjJ1Ka8awNfPinXFHuWpkpP9z7xDGY4ycnhsJSv/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmQNwCQHjJ1Ka8awNfPinXFHuWpkpP9z7xDGY4ycnhsJSv/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmQNwCQHjJ1Ka8awNfPinXFHuWpkpP9z7xDGY4ycnhsJSv/image.png 2x" /><br /> <h3><a href="https://fpl.readthedocs.io/en/latest/installation.html" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Usage & installation <p dir="auto"><center><br /> <img src="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmc6XgSZsiMhbbg7jLViojEZuKRLTRV9SAePVggCWFLM98/image.png" srcset="https://images.hive.blog/768x0/https://cdn.steemitimages.com/DQmc6XgSZsiMhbbg7jLViojEZuKRLTRV9SAePVggCWFLM98/image.png 1x, https://images.hive.blog/1536x0/https://cdn.steemitimages.com/DQmc6XgSZsiMhbbg7jLViojEZuKRLTRV9SAePVggCWFLM98/image.png 2x" /><br /> <p dir="auto">This itself hasn't been updated since the previous version, but since I include a "usage & installation" section in all my posts, I thought I might as well share this here as well. <h3>Contributing <p dir="auto">As I mentioned above, I will be adding contributor guidelines soon, but if you play FPL (or don't) and know Python, then don't hesitate to contact me on Discord (Amos#4622)!
Sort:  

Hello amosbastian,

This is a great contribution documenting all the major things in the projects.

I have staff picked this contribution because of its great detail and quality of work.

I can just suggest you to break down the work done in commits so that there is a better commit history and work is more easily readable through different commits.

Thank you for your contribution.

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]

Thanks for the review, Mohit!

I can just suggest you to break down the work done in commits so that there is a better commit history and work is more easily readable through different commits.

I feel like I did do that, though. In the pull request I linked there are 14 commits or so - how could I improve on this?

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

This is some superb work. Keep it up. 👍

Thanks - hopefully it will help future contributors and users!

Hi @amosbastian!



Feel free to join our @steem-ua Discord serverYour 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!

Congratulations @amosbastian! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td><span><img src="https://images.hive.blog/768x0/https://steemitimages.com/60x70/http://steemitboard.com/@amosbastian/posts.png?201901232041" srcset="https://images.hive.blog/768x0/https://steemitimages.com/60x70/http://steemitboard.com/@amosbastian/posts.png?201901232041 1x, https://images.hive.blog/1536x0/https://steemitimages.com/60x70/http://steemitboard.com/@amosbastian/posts.png?201901232041 2x" /><td>You published more than 250 posts. Your next target is to reach 300 posts. <p dir="auto"><sub><em><a href="https://steemitboard.com/@amosbastian" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Click here to view your Board<br /> <sub><em>If you no longer want to receive notifications, reply to this comment with the word <code>STOP <p dir="auto">To support your work, I also upvoted your post! <blockquote> <p dir="auto">Support <a href="https://steemit.com/@steemitboard" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">SteemitBoard's project! <strong><a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Vote for its witness and <strong>get one more award!

Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 10 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.

<p dir="auto">I upvoted your contribution because to my mind your post is at least <strong>6 SBD worth and should receive <strong>138 votes. It's now up to the lovely Steemit community to make this come true. <p dir="auto">I am <code>TrufflePig, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, <a href="https://steemit.com/steemit/@trufflepig/weekly-truffle-updates-2019-03" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">you can find an explanation here! <p dir="auto">Have a nice day and sincerely yours,<br /> <img src="https://images.hive.blog/768x0/https://raw.githubusercontent.com/SmokinCaterpillar/TrufflePig/master/img/trufflepig17_small.png" alt="trufflepig" srcset="https://images.hive.blog/768x0/https://raw.githubusercontent.com/SmokinCaterpillar/TrufflePig/master/img/trufflepig17_small.png 1x, https://images.hive.blog/1536x0/https://raw.githubusercontent.com/SmokinCaterpillar/TrufflePig/master/img/trufflepig17_small.png 2x" /><br /> <em><code>TrufflePig

Hi, @amosbastian!

You just got a 0.08% 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.

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!
SteemPlus or Steeditor). Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via

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

Vote for Utopian Witness!