Skip to main content

AsyncApiThrottler README

AsyncApiThrottler is a Python library designed for managing API request rate limits in asynchronous applications. It allows you to easily configure global and endpoint-specific rate limits, ensuring your application adheres to the API's rate limiting policies and prevents being blocked or rate-limited. This README provides a quick start example on how to use AsyncApiThrottler with httpx for making asynchronous API requests.

Quick Start Example

import httpx
from async_api_throttler import AsyncApiThrottler

# Initialize the throttler with a global rate limit
api_throttler = AsyncApiThrottler(max_calls=100, period=1)

# Apply endpoint-specific rate limits using the decorator
@api_throttler.limits(10, 1)
async def request_user_endpoint():
    # Make an asynchronous API request using httpx
    async with httpx.AsyncClient() as client:
        response = await client.get('https://api.example.com/user')
        return response.json()

This example demonstrates how to set up AsyncApiThrottler with a global limit of 100 requests per minute and a specific rate limit of 10 requests per minute for the '/user' endpoint. By integrating AsyncApiThrottler in this way, you ensure your application respects the API's rate limits, promoting efficient and responsible usage of resources.

Metadata

Release files for async-api-throttler 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for async-api-throttler 0.2.0
File Size Uploaded Provenance
async_api_throttler-0.2.0.tar.gz 3.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for async-api-throttler 0.2.0
File Interpreter ABI Platform
async_api_throttler-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.0 kB

Release files / async_api_throttler-0.2.0.tar.gz

Download URL async_api_throttler-0.2.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3048a3771d77bed51567dae02a0edba9de9396c04a54850143a86162cbfa98cf
BLAKE2b-256 checksum
How to use checksums
e521517c8fd33ce900cabe182e665b0cc8cb27b5dae66f2a65edcccd7e2ce500
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.9

Release files / async_api_throttler-0.2.0-py3-none-any.whl

Download URL async_api_throttler-0.2.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4154a1f303d5747c5c220614e609d4b7dee45fce154da1795ee69d3ad200d8e7
BLAKE2b-256 checksum
How to use checksums
77a34dc42821c021914485efc1581996f4e27940879a32840aa7bee8251b6b22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.9

Security for async-api-throttler 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page