Skip to content

A lightweight package that provides rate-limited httpx transports.

License

Notifications You must be signed in to change notification settings

Midnighter/httpx-limiter

Repository files navigation

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 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

async with httpx.AsyncClient(
    transport=AsyncRateLimitedTransport.create(rate=10, capacity=10),
) as client:
    ...

Copyright

About

A lightweight package that provides rate-limited httpx transports.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages