Skip to content

maghamalyan/rehttpx

Repository files navigation

ReHTTPX Logo

Version Downloads Open Issues Docs

Overview

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.

Key Features

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

Benefits

  • 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

Installation

pip install -U rehttpx

Getting Started

Minimal 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())

Compatibility with httpx

  • Built on httpx; ReClient mirrors most httpx.AsyncClient parameters.
  • Responses wrap httpx.Response for familiar methods like .json().
  • Async-only API; plus convenience features like url_params and model-aware serialization.

Documentation

For usage, guides, and API details, see the full documentation: https://rehttpx.github.io/

Contributing

Contributions are welcome! Please see the Contributing Guidelines in the documentation or CONTRIBUTING.md in the repository.

License

ReHTTPX is licensed under the MIT License. See the License file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages