ryanmcgrath/twython — pull request #313 by janezkranjc (2014-04-12 07:26:28+00:00)
Title: also return headers with the content so that x-rate-limit-remaining can be accessed

Twitter returns three important values with its headers:

* X-Rate-Limit-Limit: the rate limit ceiling for that given request
* X-Rate-Limit-Remaining: the number of requests left for the 15 minute window
* X-Rate-Limit-Reset: the remaining window before the rate limit resets in UTC epoch seconds

Please consider if this would be a useful addition to Twython. My solution is a bit invasive as it adds a key to the content dictionary, but was the easiest way for me to access the rate limits without making a second call to the Twitter API to get rate limit statuses.

With this change I could easily see how many API calls I can still make in the current window after every call.