gugarosa / viviner

🍷 Scraps data from Vivino and collects outstanding wine-based meta-data.
GNU General Public License v3.0
59 stars 30 forks source link

Invalid Syntax #1

Closed patarol closed 2 years ago

patarol commented 2 years ago

Hi @gugarosa

I'm trying to run your script, however it throws an error when I run python scrap_wine_data.py -h:

File "scrap_wine_data.py", line 52
    print(f'Number of matches: {n_matches}')
                                          ^

It fails again in:

res = r.get(f'wines/{wine["id"]}/tastes')

# File "scrap_wine_data.py", line 84
#    res = r.get(f'wines/{wine["id"]}/tastes')

Any clue how to solve this? Thank you

gugarosa commented 2 years ago

Hello Luciano! I hope everything is going well with you.

It looks like that you are using a Python version smaller than 3.6, which was the initial version that string interpolation (f-string) has been implemented.

Please let me know if that works.

Best regards, Gustavo.

patarol commented 2 years ago

Hi @gugarosa

I've managed to retrieve the information. It was because I was using python 2.7 (default in MacOSx). It seems now that the api is blocking the number of requests.

How did you managed to get all info from Brazilian wines without being blocked? Thank you again

gugarosa commented 2 years ago

If I am not mistaken, I did face this problem when I dumped the dataset and eventually just used a sleep() and left the computer running for a few days in order to dump all the information. Nevertheless, it has been a while ago, so they might have changed the number of requests or even the API blocking time.

Something that might give you a head start (if the dumped information matches your needs) is the pre-dumped dataset, which can be found here: https://www.kaggle.com/gthrosa/vivino-brazilian-wines-metadata

Hope that it helps at all!

Best regards, Gustavo.

patarol commented 2 years ago

Hi Gustavo,

I finally did managed to dump the data (Spanish wines) and will pull the changes to a fork from your repo. Thank you again for your help.

Best, Luciano

gugarosa commented 2 years ago

Awesome, glad that everything worked out!

If you think there is anything that we could do better to improve the code or documentation, please just submit a PR from your fork!

Thank you and best regards, Gustavo.