A lightning fast cooldown/ratelimit implementation.
Project description
pycooldown
Documentation | CONTRIBUTING.md
A lightning-fast cooldown/ratelimit implementation.
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.0b7.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for pycooldown-0.1.0b7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fec5fb8b1b74b02c9fe9dd6a4a867e56f3946300f1456c5048ff042c8085fe2 |
|
MD5 | 6ff0094a676b5bb62423be126bb3fc75 |
|
BLAKE2b-256 | 088ad7596cb3f0debaf23d9c36f8ddd223ea5c0731eb229d06b078a8b51ddf4a |