AnthonyBloomer / zoopla

An API to allow developers to create applications using hyper local data on 27m homes, over 1m sale and rental listings, and 15 years of sold price data in the UK.
https://anthonybloomer.github.io/zoopla/
82 stars 24 forks source link

Remove time.sleep from _call method #3

Closed ipietukhov closed 7 years ago

ipietukhov commented 7 years ago

Hi,

It's really not the best way of error processing. Could you return exception in case when rate limit reached?

AnthonyBloomer commented 7 years ago

By default, the program throws an exception if the rate limit has reached. If you pass wait_on_rate_limit = True in the constructor then the program will sleep until it can request data again.

wait_on_rate_limit is an optional argument in the constructor so you can just leave it out. For example:

zoopla = Zoopla(api_key='your_api_key', debug=True)