skillfed

smithy-http

HTTP components for Smithy tooling.

smithy-http v0.4.4 423.5K downloads/30d#6,772 on PyPI83
Permissive license Apache License 2.0 Active released

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-http

uv

uv add smithy-http

poetry

poetry add smithy-http

Installing 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

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Free Threading :: 2 - BetaProgramming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries

Tags

smithy http client testingmock http client pythonsmithy sdk http primitiveshttp testing utilitiessmithy-python transport layermock http responses testingsmithy client mocking
smithy-ecosystemtest-doublessdk-tooling

More Libraries packages