File: __init__.py

package info (click to toggle)
python-ratelimit 2.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 152 kB
  • sloc: python: 205; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 678 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'''
Function decorator for rate limiting

This module provides a functon decorator that can be used to wrap a function
such that it will raise an exception if the number of calls to that function
exceeds a maximum within a specified time window.

For examples and full documentation see the README at
https://github.com/tomasbasham/ratelimt
'''
from ratelimit.decorators import RateLimitDecorator, sleep_and_retry
from ratelimit.exception import RateLimitException

limits = RateLimitDecorator
rate_limited = RateLimitDecorator # For backwards compatibility

__all__ = [
    'RateLimitException',
    'limits',
    'rate_limited',
    'sleep_and_retry'
]

__version__ = '2.2.1'