ReHTTPX is an async-first HTTP client for Python, built on httpx and focused on production-grade API integrations. It provides out-of-the-box resilience (retries, rate limiting, caching), an extensible middleware pipeline, and intelligent serialization. ReHTTPX is async-only.
- Async-only and built on httpx
- Resilience out of the box: retries (backoff + jitter), rate limiting, caching
- Clean middleware pipeline for cross-cutting concerns
- Pydantic-friendly serialization/deserialization helpers
- URL templating via
url_params - Auth helpers (Bearer token, API key)
- Reduce boilerplate for common API client patterns
- Greater reliability under transient failures (automatic retries with backoff and jitter)
- Protect services and stay within quotas with token-bucket rate limiting
- Faster repeat calls with optional caching
- Familiar httpx surface area for easy adoption
pip install -U rehttpxMinimal request (convenience API):
import asyncio
from rehttpx import get
async def main():
resp = await get("https://httpbin.org/get")
print(resp.status_code)
asyncio.run(main())Using a client with base_url and URL templating:
import asyncio
from rehttpx import ReClient
async def main():
async with ReClient(base_url="https://api.example.com") as client:
r = await client.get("/users/{id}", url_params={"id": 123})
print(r.status_code)
asyncio.run(main())- Built on httpx;
ReClientmirrors mosthttpx.AsyncClientparameters. - Responses wrap
httpx.Responsefor familiar methods like.json(). - Async-only API; plus convenience features like
url_paramsand model-aware serialization.
For usage, guides, and API details, see the full documentation: https://rehttpx.github.io/
Contributions are welcome! Please see the Contributing Guidelines in the documentation or CONTRIBUTING.md in the repository.
ReHTTPX is licensed under the MIT License. See the License file for details.