InseeFrLab / pynsee

pynsee package contains tools to easily search and download french data from INSEE and IGN APIs
https://pynsee.readthedocs.io/en/latest/
MIT License
70 stars 10 forks source link

Insee API 429 error not consistent - API rate consumption not respected #221

Open tgrandje opened 1 month ago

tgrandje commented 1 month ago

429 error code does not seem to be consistently return by every INSEE's endpoints.

As a side effect, this impacts the API's consumption rate, as the 429 error is rarely encountered (for instance on metadata API you may easily end up with a 4/5 queries / second on the average).

hadrilec commented 1 month ago

indeed, I think we should include this feature back into the package. @tgrandje would you mind making the necessary changes so that tests pass?

tgrandje commented 1 month ago

I'll try to run the tests locally (I think I had one failure I hadn't the time to debug last week): I'm still dumbfounded about those failures on github...

tgrandje commented 1 month ago

@hadrilec locally (python 3.10) I have only one failed test, and that had already been covered by @tfardet here. Do you want me to test locally on all different python versions?

(Saddly enough, api rate consumption doesn't seem to explain why tests are freezing on github...)

hadrilec commented 1 month ago

alright, let's merge then?

tgrandje commented 1 month ago

I'd say yes