This release is a pre-release and may not be stable for production use.
benzene-http
The inbound HTTP (ASGI) transport binding for the
Benzene Python port. Host the same handlers you
wrote against benzene-core behind a real HTTP server — a standard ASGI app you can run with
uvicorn/hypercorn.
Depends on benzene-core (which pulls in
benzene-results).
pip install benzene-http
from benzene.core import message
from benzene.results import Result
from benzene.http import BenzeneHttpApp, HttpRouter, http_endpoint
@http_endpoint("GET", "/greet/{name}") # where it arrives
@message("say:hello") # which handler it resolves to
async def hello(request: dict) -> Result:
return Result.ok({"greeting": f"Hello {request['name']}"})
app = BenzeneHttpApp(HttpRouter().add(hello)) # run: uvicorn module:app
The topic is resolved from route/method conventions; the Benzene status maps to an HTTP code
(wire-contracts §4.1): ok → 200, created → 201, not-found → 404, and so on. Path params
({name}), the query string, and the JSON body merge into the handler's request (path wins, then
query, then body). Unmatched route → 404, invalid JSON body → 400, uncaught handler error → 503 —
the host is never crashed by request content.
Mirrors .NET's Benzene.Http, and contributes the benzene.http subpackage to the shared
benzene namespace.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file benzene_http-0.1.0b1.tar.gz.
File metadata
- Download URL: benzene_http-0.1.0b1.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23f769768f4ce5930ba7f41d422356abb11f02a3207fab72dcfaa00b2c820e8c
|
|
| MD5 |
ad4eb374c4623f2ea5b633048f192f30
|
|
| BLAKE2b-256 |
09f10d7c042d9f856206baf6a16e054be3643c2f7478f59fbb78d8fcf61e0c07
|
Provenance
The following attestation bundles were made for benzene_http-0.1.0b1.tar.gz:
Publisher:
release.yml on daniellepelley/benzene-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
benzene_http-0.1.0b1.tar.gz -
Subject digest:
23f769768f4ce5930ba7f41d422356abb11f02a3207fab72dcfaa00b2c820e8c - Sigstore transparency entry: 2467246838
- Sigstore integration time:
-
Permalink:
daniellepelley/benzene-python@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daniellepelley
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file benzene_http-0.1.0b1-py3-none-any.whl.
File metadata
- Download URL: benzene_http-0.1.0b1-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca08d68056ba4ac86cda223e86730001ba5855292a233a0a420f4a85028883f4
|
|
| MD5 |
638fb283eb7ba50aca3ea9e71182a533
|
|
| BLAKE2b-256 |
27e24b7564555045bde5d2fde48e10cd0b1b872ad628e906c4d0dc046bbb6209
|
Provenance
The following attestation bundles were made for benzene_http-0.1.0b1-py3-none-any.whl:
Publisher:
release.yml on daniellepelley/benzene-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
benzene_http-0.1.0b1-py3-none-any.whl -
Subject digest:
ca08d68056ba4ac86cda223e86730001ba5855292a233a0a420f4a85028883f4 - Sigstore transparency entry: 2467210080
- Sigstore integration time:
-
Permalink:
daniellepelley/benzene-python@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daniellepelley
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Trigger Event:
workflow_dispatch
-
Statement type: