Rate limiting for callable functions
Project description
Function-Limiter provides rate limiting features to callable function.
Quickstart
Add the rate limiter to your function as decorator. The following example uses the default in memory implementation for storage.
from function_limiter.limiter import Limiter
from function_limiter.limiter import RateLimitExceeded
import time
limiter = Limiter()
@limiter.limit('3/second', 'key')
def function():
print('hello world!')
for i in range(5):
function()
time.sleep(1)
for i in range(5):
function()
time.sleep(0.9)
Changelog
v0.0.6
- Release Date: 2021-01-10
Added redis as in memory storage.
v0.0.5
- Release Date: 2021-01-10
Added garbage collector.
v0.0.4
- Release Date: 2021-01-10
Added Validator to limiter.
v0.0.3
- Release Date: 2021-01-07
Added callable function for limitation and key function.
v0.0.2
- Release Date: 2021-01-07
Bug fixed.
v0.0.1
- Release Date: 2021-01-07
Basic Function Limiter.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Function-Limiter-0.0.7.2.tar.gz
(20.0 kB
view hashes)
Built Distribution
Close
Hashes for Function_Limiter-0.0.7.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f94a5ed7d9750200d451e3f4ffc1abfd784460214f946792770a7ac971f57f47 |
|
MD5 | e2832da7828d65ca2b2960a6558f8c6a |
|
BLAKE2b-256 | e6b16fdd9f2cb4be292770e820cf149473152b5011553c0a077ab2245daf2b76 |