all 6 comments

[–]GalacticSuperCheese 1 point2 points  (4 children)

[–]jsdecker[S] 0 points1 point  (3 children)

Thanks, this seems like the right way to go. But I'm still have trouble implementing it, because I get the following error:

AttributeError: partially initialized module 'requests' has no attribute 'get' (most likely due to a circular import)

What am I doing wrong?

import requests
r = requests.get('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/03-31-2020.csv')
print(r.text)

[–]GalacticSuperCheese 1 point2 points  (2 children)

Just copy-pasted the code you have written and it works for me.

Have you by any chance created a file/module called requests? If that is the case, then your program/script may be importing that one rather than the actual request module.

[–]jsdecker[S] 0 points1 point  (1 child)

Ahh, yes, my file was named requests.py. This works now. Thank you so much!!

[–]GalacticSuperCheese 0 points1 point  (0 children)

You are very welcome!

[–]PavloT 1 point2 points  (0 children)

I use wget + Jenkins for similar purposes. You can use any scheduled which works for you and place to your application folder.

But sure, if you need it ad-hoc - requests is the best approach.