A lightning fast cooldown/ratelimit implementation.
Project description
pycooldown
Documentation | CONTRIBUTING.md
A lightning-fast cooldown/ratelimit implementation using cython.
If you need support, you can contact me CircuitSacul#3397
after joining this server. I don't accept friend requests.
Example Usage
from pycooldown import FixedCooldown
cooldown = FixedCooldown(period=10, capacity=5)
def handle_event(sender):
retry_after = cooldown.update_ratelimit(sender)
if retry_after is None:
print("Event succeeded!")
else:
print(f"Too many events from {sender}. Retry in {retry_after} seconds.")
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
pycooldown-0.1.0b3.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for pycooldown-0.1.0b3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bba6b26d6233066188d621b6dc78b53342ec395aa7c178c07b6482ce8145bd6e |
|
MD5 | a4b450b15718b672ce40777f5112f9a3 |
|
BLAKE2b-256 | 187acf199a35754a37e5dda32574b37a77266004437dde14604f2e78db8c1b52 |