Skip to main content

alt-stack-http-client-httpx

Asyncio HTTP client for Python SDKs generated by alt-stack-openapi-pydantic. It is the Python counterpart of @alt-stack/http-client-core and @alt-stack/http-client-fetch: request inputs are validated and encoded with the SDK's Request map, responses are validated with its Response map, and results come back as a small discriminated union.

Install

python -m pip install alt-stack-http-client-httpx

Generated SDK modules import alt_stack_http_client_httpx at runtime, so SDK consumers install this package. The generator itself is a development-time dependency.

Use a generated SDK

from alt_stack_http_client_httpx import ApiFailure, ApiSuccess

from generated_types import GetUsersIdParams, HttpxApiClient, Request, Response

async with HttpxApiClient(
    "https://api.example.com", request_map=Request, response_map=Response
) as client:
    result = await client.get("/users/{id}", params=GetUsersIdParams(id="u_1"))

if isinstance(result, ApiSuccess):
    result.body  # User
elif isinstance(result, ApiFailure):
    result.error  # documented error model
else:
    result.error  # UnexpectedApiClientError

Importing HttpxApiClient from the generated module gives one typed method per route. Importing it from alt_stack_http_client_httpx accepts the same arguments and exposes the untyped request(method, path, ...) API with runtime validation.

Bring your own transport

BaseApiClient sends through the Transport protocol, a single async def send(request: HttpRequest) -> HttpResponse. Implement it over any asyncio HTTP library and pass it to the generated ApiClient(base_url, transport=..., request_map=Request, response_map=Response).

Scalar query floats with an integral value use integer spelling (10.0 becomes limit=10); fractional values keep their decimal spelling (2.5). Strings, booleans, repeated list values, omitted None values, and JSON bodies retain their existing encoding.

Development

uv sync --project packages/python-http-client-httpx --extra dev
packages/python-http-client-httpx/.venv/bin/pytest packages/python-http-client-httpx/tests -q
packages/python-http-client-httpx/.venv/bin/ruff check packages/python-http-client-httpx
packages/python-http-client-httpx/.venv/bin/ty check packages/python-http-client-httpx

Documentation

Metadata

Release files for alt-stack-http-client-httpx 1.7.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 alt-stack-http-client-httpx 1.7.1
File Size Uploaded
alt_stack_http_client_httpx-1.7.1.tar.gz 14.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alt-stack-http-client-httpx 1.7.1
File Interpreter ABI Platform
alt_stack_http_client_httpx-1.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.4 kB

Release files / alt_stack_http_client_httpx-1.7.1.tar.gz

Download URL alt_stack_http_client_httpx-1.7.1.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f95e04c69bc6671fdc3990e6c16e7771894a7d7cb44be9a1ee5769c89317ad0f
BLAKE2b-256 checksum
How to use checksums
3f40ce802fbddf25212d82d404278cfc7f87f7f1acdb655c07f8b9552b495e71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / alt_stack_http_client_httpx-1.7.1-py3-none-any.whl

Download URL alt_stack_http_client_httpx-1.7.1-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e32684c6e8262d68a8af473269187d9cab9bd708c7e673d88088769c6a595012
BLAKE2b-256 checksum
How to use checksums
96478ae0e65ecfbfd9b47ed5df7e8ee6b06d8299e1658ad4ad180e14b3e30064
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.7.1 This release

2 release files

1.6.2

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