Skip to main content

httpware

PyPI version Supported Python versions Downloads Coverage CI License GitHub stars Context7 uv Ruff ty

Typed, resilient HTTP clients for Python — typed errors, typed response bodies, and composable resilience (retry, bulkhead, circuit breaker), sync or async.

Why httpware

  • Errors you can catch by name — a 404 raises NotFoundError, a 429 RateLimitedError, automatically; everything else bubbles up under one httpware.StatusError base. No raise_for_status(), no status-code branching.
  • Typed response bodiesresponse_model=User decodes the body straight to your pydantic or msgspec type; a missing decoder fails fast, before the request goes out.
  • Composable resilience — retry + retry-budget, bulkhead, circuit breaker, and timeout as middleware over standard httpx2.

Built on httpx2: httpware re-exports httpx2.Request/httpx2.Response and stays a thin wrapper, not a new HTTP abstraction.

Status: Pre-1.0. Public API is subject to change between minor releases until v1.0.

Install

pip install httpware                # core only — no decoder
pip install httpware[pydantic]      # + PydanticDecoder — BaseModel, dataclasses, primitives, generics
pip install httpware[msgspec]       # + MsgspecDecoder — Struct, dataclasses, primitives, generics
pip install httpware[pydantic,msgspec]   # both — BaseModel routes to pydantic, Struct to msgspec
pip install httpware[all]           # everything (pydantic, msgspec, otel)

Quickstart

A typed GET against a live API (needs pip install httpware[pydantic]):

import asyncio

from httpware import AsyncClient
from pydantic import BaseModel


class User(BaseModel):
    id: int
    name: str


async def main() -> None:
    async with AsyncClient(base_url="https://jsonplaceholder.typicode.com") as client:
        user = await client.get("/users/1", response_model=User)
        print(user.name)  # Leanne Graham


asyncio.run(main())

The sync Client is identical — swap AsyncClientClient and drop the await / async with. A 4xx/5xx response raises a typed StatusError; a malformed body raises DecodeError. Both subclass httpware.ClientError.

Documentation

Full guides live at httpware.modern-python.org:

  • Quickstart & observability — resilience middleware, streaming, and the stable logger/event contract.
  • Middleware — write your own (auth, tracing, request-ID propagation).
  • Resilience — retry + retry-budget, bulkhead, circuit breaker, timeout.
  • Errors — the exception tree and catching strategies.
  • Testinghttpx2.MockTransport injection.
  • Recipes — DI wiring, phase-decorator patterns, link-header pagination.

🗒️ Release notes · 📦 PyPI · 📝 License

Part of modern-python

Browse the full list of templates and libraries in modern-python — see the org profile for the categorized index.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

httpware-0.16.0.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

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

httpware-0.16.0-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file httpware-0.16.0.tar.gz.

File metadata

  • Download URL: httpware-0.16.0.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for httpware-0.16.0.tar.gz
Algorithm Hash digest
SHA256 963fac5d3730b6a0adceacec383edde5647e28d0c4c1e173f21d883c001a1d66
MD5 7243976edb8adb6d6db011a2463f5bb9
BLAKE2b-256 e15da5185fa185bad81109153102b4cfb4f8c7aff78d7eb841fa141dbcaafce1

See more details on using hashes here.

File details

Details for the file httpware-0.16.0-py3-none-any.whl.

File metadata

  • Download URL: httpware-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 47.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for httpware-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e0996c8ede087c410c6b8d5266ad8420c5764f77da039444d8adffd7f646234
MD5 194aef7c2f24327985397518ecba6da7
BLAKE2b-256 c6b05739866ed50c34e5ea2867f447fb0c4d3c7760f4ca032feb186c38a3ca85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page