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 bodies — response_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 AsyncClient → Client 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.
  • Testing — httpx2.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.

Release files for httpware 0.16.1

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

Source distribution (sdist)

Source distribution for httpware 0.16.1
File Size Uploaded
httpware-0.16.1.tar.gz 36.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for httpware 0.16.1
File Interpreter ABI Platform
httpware-0.16.1-py3-none-any.whl Python 3 none any Details

Total release size: 83.2 kB

Release files / httpware-0.16.1.tar.gz

Download URL httpware-0.16.1.tar.gz
Size 36.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3905670a2d11a4aec1879f9f32c74538574856befac882d5f745287a4299126e
BLAKE2b-256 checksum
How to use checksums
c6380d3c87cf86288036ebd7f407f6e4531d7ee904f0dc535ebf90bb48df47aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","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}

Release files / httpware-0.16.1-py3-none-any.whl

Download URL httpware-0.16.1-py3-none-any.whl
Size 46.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
345ef6c18c5b306533141b448a571ce56fb10dcdb82da2968a418900b063e22c
BLAKE2b-256 checksum
How to use checksums
10ebc1f64c891be02cbff67d1dde381213b467be5f8faf0b1ae4777f4cda9885
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","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}

Release history Release notifications | RSS feed

0.17.2

2 release files

0.17.1

2 release files

0.17.0

2 release files

This release

0.16.1 This release

2 release files

0.16.0

2 release files

0.15.2

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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