This release is a pre-release and may not be stable for production use.
benzene-grpc
The gRPC edge of the Benzene Python port's wire contract. Ships the Benzene ↔ gRPC status mapping (wire-contracts.md §4.2) — the foundation of a gRPC transport binding.
Depends on benzene-core.
pip install benzene-grpc
from benzene.grpc import to_grpc, from_grpc, BENZENE_STATUS_TRAILER
to_grpc("not-found") # -> "NotFound"
to_grpc("created") # -> "OK" (all success statuses collapse to OK)
from_grpc("InvalidArgument") # -> "bad-request"
Because several Benzene statuses collapse to one gRPC code, a gRPC server MUST attach a
benzene-status trailer carrying the raw status verbatim; a client, seeing it, uses it in
preference to re-deriving from the code:
from_grpc("OK", trailer="created") # -> "created" (the trailer wins verbatim)
The mapping needs no grpcio dependency (codes are canonical name strings). The server/client
transport builds on it and adds the [transport] extra:
pip install 'benzene-grpc[transport]'
from concurrent.futures import ThreadPoolExecutor
import grpc
from benzene.core import BenzeneMessageApplication
from benzene.grpc import add_benzene_handler, GrpcMessageSender
server = grpc.server(ThreadPoolExecutor(max_workers=8))
add_benzene_handler(server, BenzeneMessageApplication(registry)) # every topic -> a unary method
server.add_insecure_port("[::]:50051"); server.start()
sender = GrpcMessageSender(grpc.insecure_channel("localhost:50051")) # a MessageSender
result = await sender.send_message("orders:place", {"sku": "A"})
The method name is the topic; the benzene-status trailer preserves the exact status across the
codes that collapse to one gRPC code. Mirrors .NET's Benzene.Grpc, and contributes the benzene.grpc
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_grpc-0.1.0b1.tar.gz.
File metadata
- Download URL: benzene_grpc-0.1.0b1.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4f6af0de97b2c2e0a211109c9bc8074c942b8e245621eeae1254b10ec27f03a
|
|
| MD5 |
64af769555cba53ba2af1e9c474e44b1
|
|
| BLAKE2b-256 |
240e781ac63562f2be928e0a81837b7af895242d0b828be8c6c9a976c941fa3a
|
Provenance
The following attestation bundles were made for benzene_grpc-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_grpc-0.1.0b1.tar.gz -
Subject digest:
f4f6af0de97b2c2e0a211109c9bc8074c942b8e245621eeae1254b10ec27f03a - Sigstore transparency entry: 2467247445
- 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_grpc-0.1.0b1-py3-none-any.whl.
File metadata
- Download URL: benzene_grpc-0.1.0b1-py3-none-any.whl
- Upload date:
- Size: 11.6 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 |
b551e12f3148f06ff0b88ac490d563a62c4fe41c381b5fbda0e0ec5abb70eee0
|
|
| MD5 |
d9443ad1bb3996679e0cba9605fdb17e
|
|
| BLAKE2b-256 |
83dc294ef3fb2cc88c29b52145ea2a55b752e1024edac1ffb6ea9db0efa79bbe
|
Provenance
The following attestation bundles were made for benzene_grpc-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_grpc-0.1.0b1-py3-none-any.whl -
Subject digest:
b551e12f3148f06ff0b88ac490d563a62c4fe41c381b5fbda0e0ec5abb70eee0 - Sigstore transparency entry: 2467210032
- 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: