Skip to main content

An httpx2 based fork of the httpx-limiter package that provides rate-limited httpx2 transports.

Project description

HTTPX2 Limiter

A lightweight package that provides rate-limited httpx2 transports.

This package is a fork of httpx-limiter version 0.6.1, migrated from httpx to httpx2.

Installation

The package is published on PyPI. Install it, for example, with the aiolimiter backend:

pip install 'httpx2-limiter[aiolimiter]'

There is also a pyrate-limiter backend available:

pip install 'httpx2-limiter[pyrate]'

Usage

Apply a rate limit to all requests made through a client by wrapping the transport. If you want to be able to make twenty requests per second, for example:

import httpx2
from httpx2_limiter import AsyncRateLimitedTransport, Rate
from httpx2_limiter.aiolimiter import AiolimiterAsyncLimiter


async def main():
    limiter = AiolimiterAsyncLimiter.create(Rate.create(magnitude=20))
    async with httpx2.AsyncClient(
        transport=AsyncRateLimitedTransport.create(limiter=limiter),
    ) as client:
        response = await client.get("https://httpbin.org/get")

More advanced use cases, such as applying multiple rate limits or different rate limits per domain, are described in the documentation.

Copyright

  • Original httpx-limiter Copyright © 2024, 2025 Moritz E. Beber.
  • httpx2-limiter Copyright © 2026 Zach Gottesman.
  • Free software distributed under the Apache Software License 2.0.

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

httpx2_limiter-1.0.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

httpx2_limiter-1.0.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file httpx2_limiter-1.0.0.tar.gz.

File metadata

  • Download URL: httpx2_limiter-1.0.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for httpx2_limiter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d41e59951b81531db84fc81cb1a71e186c67788760dc0abb66ed62faefddbc48
MD5 40431fadd58ace6cfc372f734debab16
BLAKE2b-256 359e5cf9ecdc6b2cdbcfa7b5f19f90dda78b787823a8a9fcfc5f82a7d5b64bd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for httpx2_limiter-1.0.0.tar.gz:

Publisher: publish.yml on zach-overflow/httpx2-limiter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file httpx2_limiter-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: httpx2_limiter-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for httpx2_limiter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62c6f5ed6b045d76d12ef26be6ddf15d79c29cb1076789a0bbf6aef4d4d989ac
MD5 dedb55ccae7a89e87b7f3ffd62558add
BLAKE2b-256 dbe467e2a3ae2ab4dfecc7a8df972397eef57212582a7d7645a2f773910cf98a

See more details on using hashes here.

Provenance

The following attestation bundles were made for httpx2_limiter-1.0.0-py3-none-any.whl:

Publisher: publish.yml on zach-overflow/httpx2-limiter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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