
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).
In my last post I described how I updated 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 fpl
's classes and their respective functions, updated the documentation homepage and added some examples for each class.
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/20
Index

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

Fixture

FPL
The FPL class is the main class used for interacting with Fantasy Premier League’s API. It requires a aiohttp.ClientSession for sending requests, so typical usage of the FPL class can look something like this:

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

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.

Gameweek

H2HLeague

Player

Team

User

Usage & installation

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.
Contributing
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)!