create account

Documentation for Understat by amosbastian

View this thread on: hive.blogpeakd.comecency.com
· @amosbastian ·
$56.28
Documentation for Understat
<center>
![understat.png](https://cdn.steemitimages.com/DQmNe1biaFMUVZ67VzggbsqFnERupsMeekEHQvAMmSTngMG/understat.png)
<sup>
https://github.com/amosbastian/understat
</sup>
</center>

### What is **Understat**?

It's a Python wrapper for the website [Understat](https://understat.com/), 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](https://steemit.com/understat/@amosbastian/a-small-update-to-understat), 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

<center>
![](https://cdn.steemitimages.com/DQma8C3bKdzWL5tMaiH24oXkpAnj4oME3Gvfpep8SuuMteq/image.png)
</center>

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

<center>
![](https://cdn.steemitimages.com/DQmUe7uX6TDeK4bXysbq7dsyxkCzr9caQGTCrosgFTQ1kS7/image.png)
<sup>https://understat.readthedocs.io/en/latest/user/installation.html</sup>
</center>

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

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

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

<center>
![](https://cdn.steemitimages.com/DQmQFcaZaBYiuNmrqH6HknRMbE14XxagTRFeKnqgn88Ytvj/image.png)
<sup>https://understat.readthedocs.io/en/latest/contributing/contributing.html</sup>
</center>

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.
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 180 others
properties (23)
authoramosbastian
permlinkdocumentation-for-understat
categoryunderstat
json_metadata{"community":"steempeak","app":"steempeak/1.8.4b","format":"markdown","tags":["understat","football","utopian-io","documentation","opensource"],"users":["amosbastian"],"links":["https://github.com/amosbastian/understat","https://understat.com/","https://steemit.com/understat/@amosbastian/a-small-update-to-understat","https://github.com/amosbastian/understat/pull/2","https://understat.readthedocs.io/en/latest/","https://understat.readthedocs.io/en/latest/user/installation.html","https://understat.readthedocs.io/en/latest/classes/understat.html","https://understat.com/","https://understat.readthedocs.io/en/latest/contributing/contributing.html"],"image":["https://cdn.steemitimages.com/DQmNe1biaFMUVZ67VzggbsqFnERupsMeekEHQvAMmSTngMG/understat.png","https://cdn.steemitimages.com/DQma8C3bKdzWL5tMaiH24oXkpAnj4oME3Gvfpep8SuuMteq/image.png","https://cdn.steemitimages.com/DQmUe7uX6TDeK4bXysbq7dsyxkCzr9caQGTCrosgFTQ1kS7/image.png","https://i.imgur.com/uAwcdEQ.png","https://cdn.steemitimages.com/DQmQFcaZaBYiuNmrqH6HknRMbE14XxagTRFeKnqgn88Ytvj/image.png"]}
created2019-03-20 13:32:03
last_update2019-03-20 13:32:03
depth0
children5
last_payout2019-03-27 13:32:03
cashout_time1969-12-31 23:59:59
total_payout_value42.544 HBD
curator_payout_value13.739 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,532
author_reputation174,473,586,900,705
root_title"Documentation for Understat"
beneficiaries
0.
accountutopian.pay
weight500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,622,647
net_rshares88,732,116,983,494
author_curate_reward""
vote details (244)
@ms10398 ·
$10.02
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](https://join.utopian.io/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](https://review.utopian.io/result/4/2-1-1-1-1-2-2-).

---- 
Need help? Chat with us on [Discord](https://discord.gg/uTyJkNm).

[[utopian-moderator]](https://join.utopian.io/)
πŸ‘  , , , , , , , , , , , , , ,
properties (23)
authorms10398
permlinkre-amosbastian-documentation-for-understat-20190325t191725334z
categoryunderstat
json_metadata{"tags":["understat"],"users":["amosbastian"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/4/2-1-1-1-1-2-2-","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2019-03-25 19:17:27
last_update2019-03-25 19:17:27
depth1
children1
last_payout2019-04-01 19:17:27
cashout_time1969-12-31 23:59:59
total_payout_value7.605 HBD
curator_payout_value2.411 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length916
author_reputation27,572,487,973,390
root_title"Documentation for Understat"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,935,928
net_rshares15,524,409,251,132
author_curate_reward""
vote details (15)
@utopian-io ·
Thank you for your review, @ms10398! Keep up the good work!
properties (22)
authorutopian-io
permlinkre-re-amosbastian-documentation-for-understat-20190325t191725334z-20190327t224619z
categoryunderstat
json_metadata"{"app": "beem/0.20.17"}"
created2019-03-27 22:46:21
last_update2019-03-27 22:46:21
depth2
children0
last_payout2019-04-03 22:46:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length59
author_reputation152,955,367,999,756
root_title"Documentation for Understat"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id82,065,033
net_rshares0
@steem-plus ·
SteemPlus upvote
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](https://steemit.com/@steem-plus) to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.
properties (22)
authorsteem-plus
permlinkdocumentation-for-understat---vote-steemplus
categoryunderstat
json_metadata{}
created2019-03-21 00:39:03
last_update2019-03-21 00:39:03
depth1
children0
last_payout2019-03-28 00:39:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length438
author_reputation247,952,188,232,400
root_title"Documentation for Understat"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,647,311
net_rshares0
@steem-ua ·
#### 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](https://discord.gg/KpBNYGz)**
properties (22)
authorsteem-ua
permlinkre-documentation-for-understat-20190325t193721z
categoryunderstat
json_metadata"{"app": "beem/0.20.19"}"
created2019-03-25 19:37:21
last_update2019-03-25 19:37:21
depth1
children0
last_payout2019-04-01 19:37:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length290
author_reputation23,214,230,978,060
root_title"Documentation for Understat"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,936,697
net_rshares0
@utopian-io ·
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](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)).

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

<a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
authorutopian-io
permlinkre-documentation-for-understat-20190326t043241z
categoryunderstat
json_metadata"{"app": "beem/0.20.17"}"
created2019-03-26 04:32:42
last_update2019-03-26 04:32:42
depth1
children0
last_payout2019-04-02 04:32:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length791
author_reputation152,955,367,999,756
root_title"Documentation for Understat"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,960,836
net_rshares0