smithy-http
HTTP components for Smithy tooling.
What it is and what it does
smithy-http is a low-level HTTP component library for the Smithy code generation framework's Python tooling. It defines interfaces and primitives that Smithy-generated SDK clients use to handle HTTP transport, and provides testing utilities so developers can verify client behavior without making real network requests.
The package's main entry point is MockHTTPClient, a test double that implements the HTTPClient interface and lets you queue responses, capture requests, and inspect call counts. It's designed to integrate with Smithy client configuration so you can swap in the mock during test setup. The package also includes helper functions like create_test_request() for constructing test HTTP objects and raises MockHTTPClientError when no responses are available.
Use it for:
- Unit test Smithy-generated SDK clients by mocking HTTP responses without network I/O
- Verify request structure and headers sent by a Smithy client before it reaches the network
- Simulate error conditions and edge-case HTTP responses to test client error handling
- Inspect captured requests after a client call to assert the correct operation was invoked
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides HTTP primitives, interfaces, and testing utilities for Smithy-generated Python clients, including a MockHTTPClient for testing without network calls.
Yes, if you are developing or testing code that uses a Smithy-generated Python client. The MockHTTPClient is a standard testing utility for that ecosystem. Pre-Alpha status and active maintenance are acceptable for a foundational library with no known vulnerabilities. Install only if you need Smithy client testing; it is not a general-purpose HTTP library.
Install
smithy-http on PyPI
pip
pip install smithy-httpuv
uv add smithy-httppoetry
poetry add smithy-httpInstalling smithy-http
Before you install
Active maintenance with a release 1 day old. Single runtime dependency (smithy-core) keeps install friction low. Pre-Alpha status signals this is early-stage tooling.
License in practice
Apache License 2.0 (permissive) places no significant restrictions on use, modification, or redistribution in proprietary or open-source projects.
Quickstart
pip install smithy-http
from smithy_http.testing import MockHTTPClient
mock_client = MockHTTPClient()
mock_client.add_response(status=200, headers=[("Content-Type", "application/json")], body=b'{"message": "success"}')
# Pass mock_client to your Smithy client config for testing
Requires Python 3.12 or later; intended for use with Smithy-generated Python clients.
Verify before relying
- Whether MockHTTPClient supports async/await patterns beyond the shown example
- Scope of HTTP functionality covered by the primitives layer beyond testing utilities
- Compatibility guarantees with smithy-core versions given the Pre-Alpha status
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — smithy-core |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 423,511/month — #6,772 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: smithy_http-0.4.4-py3-none-any.whl
Keywords: http, sdk, smithy
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
httmockIntercepts and mocks HTTP requests made by the…
permissive · top 5,000 on PyPI
respxRESPX mocks HTTPX and HTTP Core libraries for…
permissive · top 1,000 on PyPI
urllib3-mockMocks urllib3 HTTP requests in tests by…
permissive · top 15,000 on PyPI
smithy-coreProvides core Python interfaces and components…
permissive · top 15,000 on PyPI
smithy-jsonProvides JSON serialization and deserialization…
permissive · top 15,000 on PyPI
smithy-aws-coreProvides core runtime components and protocol…
permissive · top 15,000 on PyPI
sanic-testingProvides sync and async test clients for…
permissive · top 15,000 on PyPI
pookpook intercepts and mocks HTTP traffic for…
permissive · top 15,000 on PyPI
responsesMocks HTTP requests made by the requests…
permissive · top 1,000 on PyPI
smithy-aws-event-streamProvides low-level Python components for…
permissive · top 15,000 on PyPI