Skip to main content

A lightweight package that provides rate-limited httpx transports.

Project description

HTTPX Limiter

Package Latest PyPI Version Supported Python Versions Documentation
Meta Apache-2.0 Code of Conduct Checked with mypy Code Style Black Linting: Ruff
Automation

A lightweight package that provides rate-limited httpx transports.

Installation

The package is published on PyPI. Install it, for example, with

pip install httpx-limiter

Usage

For situations when you need to make a large number of asynchronous request with a controlled number of requests per unit time, you can apply rate limiting to an HTTPX client using the provided transport. If you want to be able to make ten requests per second, for example, use the following:

import httpx
from httpx_limiter import AsyncRateLimitedTransport, Rate

async def main():
    async with httpx.AsyncClient(
        transport=AsyncRateLimitedTransport.create(rate=Rate.create(magnitude=10)),
    ) as client:
        response = await client.get("https://httpbin.org")

Copyright

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

httpx_limiter-0.2.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

httpx_limiter-0.2.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file httpx_limiter-0.2.0.tar.gz.

File metadata

  • Download URL: httpx_limiter-0.2.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for httpx_limiter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 085e74e0c28414b2f1adea3fee68f31b1139ed66824790feb4fa57534be83cfc
MD5 3e0dbd460615bccb3cca8723ff5d32b3
BLAKE2b-256 74ad8f645704623afe117cc9f457affdb3cc98a1162646bdb788c44f690029ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for httpx_limiter-0.2.0.tar.gz:

Publisher: release.yml on Midnighter/httpx-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 httpx_limiter-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: httpx_limiter-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for httpx_limiter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6a28a19346c3b88310262b91801a600574d207b5f51eb46167247a0f7620542
MD5 f49ca1c111563636a45d41e1a8d488b7
BLAKE2b-256 80a2f6b94755bcb9e5e28bcd578b5f5786cdb9543e14144589cba56e1e199cc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for httpx_limiter-0.2.0-py3-none-any.whl:

Publisher: release.yml on Midnighter/httpx-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