create account

RE: Introducing Understat, a Python package for revolutionary football metrics by emrebeyler

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @amosbastian/introducing-understat-a-python-package-for-revolutionary-football-metrics

· @emrebeyler ·
$13.71
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/)
👍  , , , , , , , , , ,
properties (23)
authoremrebeyler
permlinkre-amosbastian-introducing-understat-a-python-package-for-revolutionary-football-metrics-20190308t160231665z
categoryunderstat
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"}
created2019-03-08 16:02:33
last_update2019-03-08 16:02:33
depth1
children2
last_payout2019-03-15 16:02:33
cashout_time1969-12-31 23:59:59
total_payout_value10.392 HBD
curator_payout_value3.313 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,602
author_reputation448,535,049,068,622
root_title"Introducing Understat, a Python package for revolutionary football metrics"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id80,927,084
net_rshares18,691,668,772,708
author_curate_reward""
vote details (11)
@amosbastian ·
Thanks for the review, Emre! I think you are correct for both cases, so I'll change both for the next version.
👍  , , , ,
properties (23)
authoramosbastian
permlinkre-emrebeyler-re-amosbastian-introducing-understat-a-python-package-for-revolutionary-football-metrics-20190308t161007571z
categoryunderstat
json_metadata{"tags":["understat"],"app":"steemit/0.1"}
created2019-03-08 16:10:09
last_update2019-03-08 16:10:09
depth2
children0
last_payout2019-03-15 16:10:09
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_length110
author_reputation174,473,586,900,705
root_title"Introducing Understat, a Python package for revolutionary football metrics"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id80,927,401
net_rshares7,160,038,340
author_curate_reward""
vote details (5)
@utopian-io ·
Thank you for your review, @emrebeyler! Keep up the good work!
properties (22)
authorutopian-io
permlinkre-re-amosbastian-introducing-understat-a-python-package-for-revolutionary-football-metrics-20190308t160231665z-20190311t015649z
categoryunderstat
json_metadata"{"app": "beem/0.20.17"}"
created2019-03-11 01:56:51
last_update2019-03-11 01:56:51
depth2
children0
last_payout2019-03-18 01:56:51
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_length62
author_reputation152,955,367,999,756
root_title"Introducing Understat, a Python package for revolutionary football metrics"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,043,142
net_rshares0