Skip to main content

Python bindings for, a ratelimiting library written in Rust.

Project description

Floodgate-rs

Python bindings for floodgate, a ratelimiting library written in rust.

Example

from datetime import timedelta
from floodgate import FixedMapping

cooldown = FixedMapping(capacity=5, period=timedelta(seconds=20))

def handle_event(sender):
    retry_after = cooldown.trigger(sender)
    if retry_after is None:
        print("Event succeeded!")
    else:
        print(f"Too many events from {sender}. Retry in {retry_after} seconds.")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

floodgate_rs-0.1.2.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distributions

floodgate_rs-0.1.2-cp311-none-win_amd64.whl (160.2 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

floodgate_rs-0.1.2-cp311-none-win32.whl (153.9 kB view hashes)

Uploaded CPython 3.11 Windows x86

floodgate_rs-0.1.2-cp311-cp311-musllinux_1_1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

floodgate_rs-0.1.2-cp311-cp311-musllinux_1_1_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ ARM64

floodgate_rs-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

floodgate_rs-0.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

floodgate_rs-0.1.2-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.12+ i686 manylinux: glibc 2.17+ i686

floodgate_rs-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (281.1 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

floodgate_rs-0.1.2-cp311-cp311-macosx_10_9_x86_64.whl (277.3 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

floodgate_rs-0.1.2-cp310-none-win_amd64.whl (160.2 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

floodgate_rs-0.1.2-cp310-none-win32.whl (153.9 kB view hashes)

Uploaded CPython 3.10 Windows x86

floodgate_rs-0.1.2-cp310-cp310-musllinux_1_1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

floodgate_rs-0.1.2-cp310-cp310-musllinux_1_1_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ ARM64

floodgate_rs-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

floodgate_rs-0.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

floodgate_rs-0.1.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ i686 manylinux: glibc 2.17+ i686

floodgate_rs-0.1.2-cp310-cp310-macosx_11_0_arm64.whl (281.1 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

floodgate_rs-0.1.2-cp310-cp310-macosx_10_9_x86_64.whl (277.3 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

floodgate_rs-0.1.2-cp39-none-win_amd64.whl (160.4 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

floodgate_rs-0.1.2-cp39-none-win32.whl (154.2 kB view hashes)

Uploaded CPython 3.9 Windows x86

floodgate_rs-0.1.2-cp39-cp39-musllinux_1_1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

floodgate_rs-0.1.2-cp39-cp39-musllinux_1_1_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ ARM64

floodgate_rs-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

floodgate_rs-0.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

floodgate_rs-0.1.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686 manylinux: glibc 2.17+ i686

floodgate_rs-0.1.2-cp39-cp39-macosx_11_0_arm64.whl (281.4 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

floodgate_rs-0.1.2-cp39-cp39-macosx_10_9_x86_64.whl (277.6 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

floodgate_rs-0.1.2-cp38-none-win_amd64.whl (160.3 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

floodgate_rs-0.1.2-cp38-none-win32.whl (154.5 kB view hashes)

Uploaded CPython 3.8 Windows x86

floodgate_rs-0.1.2-cp38-cp38-musllinux_1_1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

floodgate_rs-0.1.2-cp38-cp38-musllinux_1_1_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ ARM64

floodgate_rs-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

floodgate_rs-0.1.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

floodgate_rs-0.1.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686 manylinux: glibc 2.17+ i686

floodgate_rs-0.1.2-cp38-cp38-macosx_11_0_arm64.whl (281.4 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

floodgate_rs-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl (277.7 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page