Decorator that limits the calling rate of a function
This decorator limits the calling rate of the decorated function. This is useful in conjuction with web API calls, where you often get banned if you perform more calls than the ones specified in the terms of services.
The rate is limit over every, where limit is the number of invocation allowed every every seconds. limit(4, 60) creates a decorator that limits the function calls to 4 per minute. If not specified, every defaults to 1 second.
@limit(4, 60) def function(...): """never invoke this function more than 4 times per minute.""" ...
The package has been uploaded to PyPI, so you can install it with pip:
pip install limit
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size limit-0.2.3.tar.gz (1.9 kB)||File type Source||Python version None||Upload date||Hashes View hashes|