Skip to content

Commit a975d12

Browse files
committed
docs(index): sync with shipped 0.4 features
- Drop '0.1.0 alpha' from the status line - Rewrite the project description (pre-v0.2 wording claimed 'owns the abstraction layer / consumers never import the transport' — both walked back in v0.2) - Add the pydantic extra to the install block (was added in 0.3.0) - Add a 'With resilience middleware' subsection mirroring the README - Add an 'Errors' section - Fix the dead 'Engineering Notes' link (target file doesn't exist in docs/ tree; point to GH URL of planning/engineering.md instead) - Fix the now-incorrect 'five protocol seams' claim (v0.2 collapsed to three) - Add a Release notes link
1 parent 665c0e0 commit a975d12

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

docs/index.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# httpware
22

3-
A Python async HTTP client framework for building resilient service clients. `httpware` owns the abstraction layer above the underlying HTTP client (`httpx2` by default); consumers never import the transport directly.
3+
A Python async HTTP client framework for building resilient service clients. `httpware` is a thin opinionated wrapper around `httpx2` — it re-exports `httpx2.Request`/`httpx2.Response` as the public request/response surface, adds a middleware chain (with a built-in resilience suite: `Retry` + `RetryBudget`, `Bulkhead`), opt-in typed response decoding, and a status-keyed exception tree raised automatically on 4xx/5xx.
44

5-
> **Status:** Pre-1.0 (0.1.0 alpha). Public API is subject to change between minor releases until v1.0.
5+
> **Status:** Pre-1.0. Public API is subject to change between minor releases until v1.0. Streaming and observability are not yet shipped.
66
77
## Install
88

@@ -13,6 +13,7 @@ pip install httpware
1313
Optional extras:
1414

1515
```bash
16+
pip install httpware[pydantic] # PydanticDecoder (the default decoder path)
1617
pip install httpware[msgspec] # MsgspecDecoder
1718
```
1819

@@ -39,10 +40,34 @@ async def main() -> None:
3940
asyncio.run(main())
4041
```
4142

43+
### With resilience middleware
44+
45+
Compose resilience middleware at construction; `Bulkhead` goes outside `Retry` so one slot covers all retry attempts.
46+
47+
```python
48+
from httpware import AsyncClient, Bulkhead, Retry
49+
50+
51+
async def main() -> None:
52+
async with AsyncClient(
53+
base_url="https://api.example.com",
54+
middleware=[
55+
Bulkhead(max_concurrent=10), # cap total in-flight
56+
Retry(), # default: 3 attempts, full-jitter backoff
57+
],
58+
) as client:
59+
user = await client.get("/users/1", response_model=User)
60+
```
61+
62+
## Errors
63+
64+
All 4xx/5xx responses raise typed exceptions automatically: `NotFoundError`, `ServiceUnavailableError`, `RateLimitedError`, etc. — all subclasses of `httpware.StatusError`. Transport-layer transient failures raise `NetworkError`; the resilience middleware raise `RetryBudgetExhaustedError` and `BulkheadFullError`. Everything inherits `httpware.ClientError`.
65+
4266
## Where to go next
4367

44-
- **[Engineering Notes](dev/engineering.md)** — design invariants, the five protocol seams, exception contract, module layout, testing patterns, optional-extras pattern.
68+
- **[Engineering Notes](https://github.com/modern-python/httpware/blob/main/planning/engineering.md)** — design invariants, the three protocol seams, exception contract, module layout, testing patterns, optional-extras pattern. Lives in the repo at `planning/engineering.md`.
4569
- **[Contributing](dev/contributing.md)** — setup, conventions, workflow.
70+
- **[Release notes](https://github.com/modern-python/httpware/releases)** — per-version changelogs.
4671

4772
## Part of `modern-python`
4873

0 commit comments

Comments
 (0)