Documentation for Understat

in #understat5 years ago


understat.png

https://github.com/amosbastian/understat

What is Understat?

It's a Python wrapper for the website Understat, which provides revolutionary football metrics multiple leagues. An example of this is expected goals (xG), which is the main new revolutionary football metric, and allows you to evaluate team and player performance. In a low-scoring game such as football, the final score does not really provide a clear picture of the teams' performances, and this is why more and more sports analytics turn to the advanced models like xG, which is a statistical measure of the quality of chances created and conceded. Understat's goal was to create the most precise method for shot quality evaluation. They did this by training neural network prediction algorithms with a large dataset (>100,000 shots, over 10 parameters for each), and have now made this data available for the public!


Yesterday I posted about a small update, and in there I mentioned I had written some documentation for it as well. In this post I'll detail what kind of documentation I added exactly!

https://github.com/amosbastian/understat/pull/2

The pull request also includes the functions I added, so I'm sorry for that. You can find the changes relevant to this update in the .rst files. Basically I added documentation for all the functions in the Understat class, and also some documentation about installing and contributing, which I copied from the documentation of my other package, fpl:

https://understat.readthedocs.io/en/latest/

Homepage



I've added a basic example showing how to use understat with asyncio and aiohttp. I've also added three sections, one for installing it, one for all the functions in the Understat class, and another about contributing.

Installation



https://understat.readthedocs.io/en/latest/user/installation.html

As you may expect, installing a Python package isn't exactly difficult, and so I've just copied the instructions from fpl's documentation, and changed all references to fpl to understat.

The functions


![](https://i.imgur.com/uAwcdEQ.png)
Documentation for the get_teams() function. See: https://understat.readthedocs.io/en/latest/classes/understat.html for the rest of the documentation.

Unlike the other parts of the documentation this was made completely from scratch. Since there isn't an API, it's pretty important for people to understand what kind of information they are getting and in what kind of format. Because of this I've added usage examples for every function, with also example output.

Of course this means there is A LOT of documentation for people to go through, but I think this was the best way of doing it. Now they don't have to run the functions themselves to see what the output is, and can simply check the documentation for a reference.

As you can see in the image above (showing an example of the documentation for 1 of the functions), I've also included screenshots taken on https://understat.com/ to show people, who are probably used to using the website, the equivalent data found on there. I also think this will give a good idea to users of what to expect from the output, and so they'll understand the functions easier and more quickly.

Contributing



https://understat.readthedocs.io/en/latest/contributing/contributing.html

Just like the installation section, this was copied completely from my other package fpl. Not much to say here because of that, but hopefully it will help people if they are interested in contributing.

Roadmap

I'm going to be posting about it on Reddit today, so hopefully I will get some more people interested in using it (and maybe also contributing). Maybe they will even come up with some suggestions as well, and depending on the feedback received the roadmap will change, so I'll wait and see.

Sort:  

Hello @amosbastian,

This was a great contribution from your end.

As I have seen you have greatly improved in writing documentation contribution since you started.

This contribution uses all latest standards for writing documentation which is great to see.

This is my first time seeing contribution by you in this project so I would look more into what's the project about :).

This contribution is selected as a staff pick as it shows a good amount of work done.

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.05% 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.

Hi @amosbastian!

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

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!