xmunoz / sodapy

Python client for the Socrata Open Data API
MIT License
402 stars 114 forks source link

Read timeout error #38

Closed mansjun closed 6 years ago

mansjun commented 6 years ago

when I run results = client.get("s6ew-h6mp") in python, I get below error, any idea how I can fix it?

ReadTimeout: HTTPSConnectionPool(host='data.consumerfinance.gov', port=443): Read timed out. (read timeout=10)

xmunoz commented 6 years ago

This is a network error, which is unrelated to the functionality of this wrapper library. Check your internet connectivity and try again.

mansjun commented 6 years ago

is it because the file is too large or because API version issue 2.0 vs 2.1? because if I run

results = client.get("s6ew-h6mp", limit=50000) it works, it doesn't work if limit beyond 50000, it return timeout error.

xmunoz commented 6 years ago

This is a question for the socrata devs, and unrelated to the functionality of this library. If you experience high latency when fetching a large number of records, you can set a custom timeout when you initialize the client. https://github.com/xmunoz/sodapy/blob/master/sodapy/__init__.py#L25

More reading: http://docs.python-requests.org/en/master/user/advanced/#timeouts