Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

benzene-core

The transport-neutral message-handling engine of the Benzene Python port: the handler registry and @message decorator, the middleware pipeline, a minimal per-invocation DI container, request/ response mapping, and the BenzeneMessageApplication envelope entry point.

Depends only on benzene-results. No transport code.

pip install benzene-core
from benzene.core import BenzeneMessageApplication, Registry, message
from benzene.results import Result

@message("say:hello")
async def hello(request: dict) -> Result:
    return Result.ok({"greeting": f"Hello {request['name']}"})

app = BenzeneMessageApplication(Registry().add(hello))

# Drive it with a transport-neutral Benzene message envelope:
response = await app.handle(
    {"topic": "say:hello", "headers": {}, "body": '{"name": "world"}'}
)
# -> {"statusCode": "ok", "headers": {"content-type": "application/json"},
#     "body": '{"greeting": "Hello world"}'}

Install a transport binding on top (e.g. benzene-http) to host these handlers over a real protocol. Mirrors .NET's Benzene.Core + Benzene.Core.MessageHandlers + Benzene.Dependencies, and contributes the benzene.core 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_core-0.1.0b1.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

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

benzene_core-0.1.0b1-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

Details for the file benzene_core-0.1.0b1.tar.gz.

File metadata

  • Download URL: benzene_core-0.1.0b1.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for benzene_core-0.1.0b1.tar.gz
Algorithm Hash digest
SHA256 133f8c910be03463bd372fb56d80ad08f53fcb9f6ac5342456fc26f53b7284cd
MD5 fb555852e2cfc310122fb5e31e8d5a85
BLAKE2b-256 575cb73e33081e7d708461cb188a738eea5a2b01e13fc5fa5214a7f98a78bfb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for benzene_core-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_core-0.1.0b1-py3-none-any.whl.

File metadata

  • Download URL: benzene_core-0.1.0b1-py3-none-any.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for benzene_core-0.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 319c928c3e7261a1da29d7145c0bdc2cf5eeaae679d1a95a75a0833673435a50
MD5 1f6c1a4d2e9b3baba2ef2e3093340e49
BLAKE2b-256 e6b7f23981613e42d5c148858f3ab6526ffefea34609a603ab9ac556dd271e0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for benzene_core-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