Limiter - in Utility Submodule: Functions and Classes#

This module provides a mixture of helpers to support rate limiting and also functions for conversion?

Summary Functions#

get_rates_from_response_headers(headers, method)

Returns a namedtuple with values for short - and long usage and limit rates found in provided HTTP response headers

get_seconds_until_next_quarter([now])

Returns the number of seconds until the next quarter of an hour.

get_seconds_until_next_day([now])

Returns the number of seconds until the next day (utc midnight).

Summary Classes#

SleepingRateLimitRule([priority])

A rate limit rule that can be prioritized and can dynamically adapt its limits based on API responses.

RateLimiter()

DefaultRateLimiter([priority])

Implements something similar to the default rate limit for Strava apps.

RequestRate(short_usage, long_usage, ...)

Tuple containing request usage and usage limit.