$npx skillfedfor your agent

pyrate-limiter

Python Rate-Limiter using Leaky-Bucket Algorithm

Worth itPyPI Python ModulesReleased Jun 20267.9M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pyrate_limiter-4.4.0-py3-none-any.whl
v4.4.0 · released 2026-06-14 · Python >=3.10

Yes. PyrateLimiter is a mature, well-maintained library with zero known vulnerabilities, no runtime dependencies, and permissive licensing. It solves a common problem (rate limiting) with a clean API that works seamlessly in both sync and async code. Install it if you need to enforce request quotas or throttle access to resources.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later.
  • Low friction: pure Python wheel with no runtime dependencies.
  • Active maintenance with a recent release (61 days ago) and 512 repository stars.

License · maintenance · safety

MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.

last release 2026-06-14 (61 days) · last repo commit 2026-06-14 · 512 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 7,896,876 downloads/mo, #1,683 on PyPI

Verify before relying

pip install pyrate-limiter

from pyrate_limiter import Duration, Rate, Limiter

limiter = Limiter(Rate(5, Duration.SECOND * 2))
limiter.try_acquire("my-resource")
  • Performance characteristics under high concurrency or with large numbers of keys
  • Behavior and overhead of each backend option (in-memory vs. Redis vs. Postgres) at scale
  • Exact semantics of the leaking mechanism and background cleanup scheduling
Same gist for agents: .md · .json

What it is and what it does

PyrateLimiter is a rate-limiting library that enforces request quotas using the Leaky-Bucket algorithm. It allows you to define multiple simultaneous rate limits (e.g., 5 per second and 1000 per hour) on the same key, and routes each key to a bucket that tracks and throttles incoming requests. The library works in both sync and async contexts, offering blocking (wait for a permit), non-blocking (fail fast), and timeout-based acquisition modes.

The package supports multiple storage backends: in-memory buckets for single-process use, SQLite for persistence, Redis (sync and async) for distributed systems, Postgres for shared state, and multiprocessing for worker pools. You can use it directly via `try_acquire()` calls, as a decorator on functions, or as a context manager. The same API works identically in sync and async code paths without blocking the event loop.

Use it for

  • Enforce API rate limits on web services (e.g., 100 requests per minute per user)
  • Throttle background job workers to avoid overwhelming downstream services
  • Distribute rate limits across multiple processes or machines using Redis or Postgres
  • Implement per-resource quotas in multi-tenant applications with independent tracking
  • Decorate async functions to prevent concurrent request spikes without blocking

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

PyrateLimiter is a mature, well-maintained library with zero known vulnerabilities, no runtime dependencies, and permissive licensing. It solves a common problem (rate limiting) with a clean API that works seamlessly in both sync and async code. Install it if you need to enforce request quotas or throttle access to resources.

Install

pyrate-limiter on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Active maintenance with a recent release (61 days ago) and 512 repository stars. Supports Python 3.10 through 3.14.

Requires Python 3.10 or later.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.

Quickstart

pip install pyrate-limiter

from pyrate_limiter import Duration, Rate, Limiter

limiter = Limiter(Rate(5, Duration.SECOND * 2))
limiter.try_acquire("my-resource")

Verify before relying

  • Performance characteristics under high concurrency or with large numbers of keys
  • Behavior and overhead of each backend option (in-memory vs. Redis vs. Postgres) at scale
  • Exact semantics of the leaking mechanism and background cleanup scheduling

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 61 days since the last release
Last repo commit
First released
Downloads7,896,876 / month, #1,683 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: DocumentationTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Evidence: pyrate_limiter-4.4.0-py3-none-any.whl

Tags

Capabilities
rate limiter pythonleaky bucket algorithmasync rate limitingrequest throttlingper-key rate limitsredis rate limiterapi quota enforcement
Topics
rate-limitingasync-friendlydistributed
PyPI keywords
aiohttphttpxleaky-bucketlimiterraterate-limiterrate_limiterratelimitratelimiterratelimitingrequeststhrottle

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “per-key rate limits”

  • pyrate-limiterPyrateLimiter implements the Leaky-Bucket rate-limiting algorithm…
  • httpx-limiterProvides rate-limited HTTP transports for httpx clients, supporting…
  • asgi-ratelimitAn ASGI middleware that enforces rate limits on HTTP requests by user…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also requests-ratelimiter · rush · fastapi-limiter · throttled-py · httpx-limiter · aiolimiter · asynciolimiter · limits · slowapi · upstash-ratelimit