Resilience-first async HTTP client framework for Python
Project description
httpware
Async HTTP client framework for Python.
httpware is a typed, async HTTP client library built on httpx2 with a protocol-based seam so the transport is swappable. Middleware composes via an onion model. Pydantic and msgspec response decoding ship out of the box. RecordedTransport replaces respx for transport-level tests.
Status: Pre-1.0 (0.1.0 alpha). Public API is subject to change between minor releases until v1.0. Resilience middleware (retry / timeout / bulkhead), streaming, and observability are not yet shipped — track progress on GitHub.
Install
pip install httpware
Optional extras:
pip install httpware[msgspec] # MsgspecDecoder
(otel, niquests, and all extras are declared but their integrations have not shipped yet.)
Quickstart
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://api.example.com") as client:
user = await client.get("/users/1", response_model=User)
print(user.name)
What ships in 0.1.0
AsyncClient— eight HTTP method shortcuts (get,post,put,patch,delete,head,options,request) with typedresponse_modeloverloads; per-call overrides forheaders,params,cookies,timeout,json,content; httpx-stylebase_urljoin;with_options(...)returns a view sharing the same transport.- Transport-agnostic seam.
httpx2is confined tohttpware.transports.httpx2.Httpx2Transport. Implement theTransportprotocol to swap backends. - Middleware foundation.
Middlewareprotocol,Nexttype alias, recursive-closurecompose()chain composition, and phase decorators (@before_request,@after_response,@on_error). - Pluggable response decoding.
PydanticDecoder(default) with cachedTypeAdapter;MsgspecDecoderviahttpware[msgspec]. RecordedTransport— built-in test double with a route table, observed-request list, andaclose_callscounter.- Status-keyed exception hierarchy —
StatusError, 4xx / 5xx subclasses, plain typed fields (status: int,body: bytes,headers,json,request_method,request_url). Pickleable; userinfo redacted in__repr__. - No
httpx2exception types leak throughhttpware. The transport seam maps them tohttpwareexceptions.
Part of modern-python
Browse the full list of templates and libraries in modern-python — see the org profile for the categorized index.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file httpware-0.1.0.tar.gz.
File metadata
- Download URL: httpware-0.1.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5947e51a699137a2d7fd9ab30b947ca529319295a8d610d3505d1c5f4609b3f1
|
|
| MD5 |
15dba6606d4909c233fd6f547a96d421
|
|
| BLAKE2b-256 |
06889936993de31e49b268239f8607e548dc79159957cba3eb76c38439e7b57a
|
File details
Details for the file httpware-0.1.0-py3-none-any.whl.
File metadata
- Download URL: httpware-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78d25cf402d9cc4766ea0971741ba1a5903b5ac2906168f146edd371a7760fde
|
|
| MD5 |
49c610d6706cbd8936b4fb4743e19c4c
|
|
| BLAKE2b-256 |
cfb01d5d787e3a57ba20921d7ee9df973353a3cb325bc092f82d83453f63de8c
|