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).

Development

uv run --project packages/python-http-client-httpx --extra dev pytest packages/python-http-client-httpx/tests
uv run --project packages/python-http-client-httpx --extra dev ruff check packages/python-http-client-httpx
uv run --project packages/python-http-client-httpx --extra dev ty check packages/python-http-client-httpx

Documentation

Metadata

Release files for alt-stack-http-client-httpx 1.6.2

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.6.2
File Size Uploaded
alt_stack_http_client_httpx-1.6.2.tar.gz 14.0 kB Details

Built distribution (wheel)

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

Total release size: 23.6 kB

Release files / alt_stack_http_client_httpx-1.6.2.tar.gz

Download URL alt_stack_http_client_httpx-1.6.2.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f739c700d7b30c1d5ee5eb82fac0ec494309070972bd630c935f99b335e00926
BLAKE2b-256 checksum
How to use checksums
521a96ee1d4cbdefe2b247c815da71f4806fbb8650f7b4bcc72aa2acda14bb69
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 Sep 4, 2026.

Transparency log

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

Download URL alt_stack_http_client_httpx-1.6.2-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29815f817fb3ec29357ecfe090a95cbfab2fc96e4dc7148ccc3cabfe5c17afb4
BLAKE2b-256 checksum
How to use checksums
83cdc374db64ad15da969a5915951eb576c782aad5b22c18a04b663a0a5e8070
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 Sep 4, 2026.

Transparency log

Release history Release notifications | RSS feed

1.7.1

2 release files

This release

1.6.2 This release

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