I find my code scattered with this pattern:
response = requests.get(url, headers=HEADERS)
if response.status_code == 429:
# sleep and try again until some limit
elif response.status_code != 200:
response.raise_for_status()
result=response.json()
Of course, I can make my own wrapper function, but ... this seems like a really common thing. Is there an existing slightly-higher-level call that already exists that I should be using?