Viewing a response to: @amosbastian/introducing-understat-a-python-package-for-revolutionary-football-metrics
It's cool to see you use asyncio instead of sync requests. Package look good with all the code/docstrings/unit tests. I have minor comments, some may be opinionated: > So instead of using an API, the way the data is retrieved is by scraping their website for `<script>`s, and using a regular expression to match the data we want. Btw, by seeing the name "wrapper", I thought it was an API wrapper. :) Maybe calling it scraper or something like that may be better. ``` def find_match(scripts, pattern): """Returns the first match found in the given scripts.""" for script in scripts: match = re.search(pattern, script.string) if match: break return match ``` This may be refactored into sth like that maybe? (This changes the behaviour slightly, though. Current impl. will throw an error if it can't find a match, while the alternative one returns None if there are no matches) ``` def find_match(scripts, pattern): """Returns the first match found in the given scripts.""" for script in scripts: match = re.search(pattern, script.string) if match: return match ``` *** 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/3/1-2-2-1-2-1-1-). ---- Need help? Chat with us on [Discord](https://discord.gg/uTyJkNm). [[utopian-moderator]](https://join.utopian.io/)
author | emrebeyler |
---|---|
permlink | re-amosbastian-introducing-understat-a-python-package-for-revolutionary-football-metrics-20190308t160231665z |
category | understat |
json_metadata | {"tags":["understat"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/3/1-2-2-1-2-1-1-","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"} |
created | 2019-03-08 16:02:33 |
last_update | 2019-03-08 16:02:33 |
depth | 1 |
children | 2 |
last_payout | 2019-03-15 16:02:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 10.392 HBD |
curator_payout_value | 3.313 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,602 |
author_reputation | 448,535,049,068,622 |
root_title | "Introducing Understat, a Python package for revolutionary football metrics" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 80,927,084 |
net_rshares | 18,691,668,772,708 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
espoem | 0 | 28,259,986,763 | 15% | ||
utopian-io | 0 | 18,455,988,946,312 | 13.11% | ||
jaff8 | 0 | 46,500,541,992 | 21.3% | ||
emrebeyler | 0 | 6,353,908,505 | 1% | ||
aydant | 0 | 4,651,224,979 | 50% | ||
amosbastian | 0 | 64,524,422,090 | 21.3% | ||
holger80 | 0 | 55,972,404,422 | 10% | ||
reazuliqbal | 0 | 17,419,462,307 | 10% | ||
statsexpert | 0 | 7,804,943,754 | 100% | ||
curbot | 0 | 2,420,209,043 | 100% | ||
ascorphat | 0 | 1,772,722,541 | 2.5% |
Thanks for the review, Emre! I think you are correct for both cases, so I'll change both for the next version.
author | amosbastian |
---|---|
permlink | re-emrebeyler-re-amosbastian-introducing-understat-a-python-package-for-revolutionary-football-metrics-20190308t161007571z |
category | understat |
json_metadata | {"tags":["understat"],"app":"steemit/0.1"} |
created | 2019-03-08 16:10:09 |
last_update | 2019-03-08 16:10:09 |
depth | 2 |
children | 0 |
last_payout | 2019-03-15 16:10:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 110 |
author_reputation | 174,473,586,900,705 |
root_title | "Introducing Understat, a Python package for revolutionary football metrics" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 80,927,401 |
net_rshares | 7,160,038,340 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
elviento | 0 | 261,768,034 | 0.5% | ||
shammi | 0 | 367,993,286 | 7% | ||
steemtaker | 0 | 5,965,058,155 | 6% | ||
penghuren | 0 | 496,439,025 | 90% | ||
oscarliam | 0 | 68,779,840 | 100% |
Thank you for your review, @emrebeyler! Keep up the good work!
author | utopian-io |
---|---|
permlink | re-re-amosbastian-introducing-understat-a-python-package-for-revolutionary-football-metrics-20190308t160231665z-20190311t015649z |
category | understat |
json_metadata | "{"app": "beem/0.20.17"}" |
created | 2019-03-11 01:56:51 |
last_update | 2019-03-11 01:56:51 |
depth | 2 |
children | 0 |
last_payout | 2019-03-18 01:56:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 62 |
author_reputation | 152,955,367,999,756 |
root_title | "Introducing Understat, a Python package for revolutionary football metrics" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 81,043,142 |
net_rshares | 0 |