PySheets / pysheets

Source for PySheets
Other
111 stars 7 forks source link

unable to import csv by url #125

Open EricSHo opened 5 days ago

EricSHo commented 5 days ago

I tried to import a csv file into pysheets via the menu option File/Import and paste a URL

Or through script

pysheets.load_sheet("https://openintro.org/data/csv/acs12.csv")

Both ways encountered HTTPError.

The path has been checked using R; it can be read into a data frame.

I know there is a similar issue raised in #101.

I wanted to know alternative ways to load a file into pysheets if the abovementioned approach did not work.

Thanks, Eric.

laffra commented 4 days ago

This was caused by the PySheets server not passing along the request headers correctly. Looks like openintro.org really wants to see a "user-agent" header present on the request.

Thanks for reporting this issue. This now works on https://pysheets.app.

image