Skip to main content
Pre-release

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

benzene_http-0.1.0b1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

benzene_http-0.1.0b1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

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

Hashes for benzene_http-0.1.0b1.tar.gz
Algorithm Hash digest
SHA256 23f769768f4ce5930ba7f41d422356abb11f02a3207fab72dcfaa00b2c820e8c
MD5 ad4eb374c4623f2ea5b633048f192f30
BLAKE2b-256 09f10d7c042d9f856206baf6a16e054be3643c2f7478f59fbb78d8fcf61e0c07

See more details on using hashes here.

Provenance

The following attestation bundles were made for benzene_http-0.1.0b1.tar.gz:

Publisher: release.yml on daniellepelley/benzene-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for benzene_http-0.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca08d68056ba4ac86cda223e86730001ba5855292a233a0a420f4a85028883f4
MD5 638fb283eb7ba50aca3ea9e71182a533
BLAKE2b-256 27e24b7564555045bde5d2fde48e10cd0b1b872ad628e906c4d0dc046bbb6209

See more details on using hashes here.

Provenance

The following attestation bundles were made for benzene_http-0.1.0b1-py3-none-any.whl:

Publisher: release.yml on daniellepelley/benzene-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0b1 This release

2 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