Skip to main content
Pre-release

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, and a failure's structured errors cross as a google.rpc.BadRequest on the grpc-status-details-bin trailer (§4.2) — gRPC drops the body of a non-OK call, so that trailer is where a per-field validation error survives the hop. Mirrors .NET's Benzene.Grpc, and contributes the benzene.grpc subpackage to the shared benzene namespace.

Metadata

Release files for benzene-grpc 0.1.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for benzene-grpc 0.1.0b2
File Size Uploaded Provenance Actions
benzene_grpc-0.1.0b2.tar.gz 13.3 kB With provenance Details for benzene_grpc-0.1.0b2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for benzene-grpc 0.1.0b2
File Interpreter ABI Platform Actions
benzene_grpc-0.1.0b2-py3-none-any.whl Python 3 none any Details for benzene_grpc-0.1.0b2-py3-none-any.whl

Total release size: 30.9 kB

Release files / benzene_grpc-0.1.0b2.tar.gz

Download URL benzene_grpc-0.1.0b2.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a0e5e09dff63f716d029dc1d76ca9c3e428eae42956fd1f37ff67c3182ceefa2
BLAKE2b-256 checksum
How to use checksums
02911c0245bb771c641956773fa7ea172ae578d2f42ef72a2d65acb5ea5213aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

Release files / benzene_grpc-0.1.0b2-py3-none-any.whl

Download URL benzene_grpc-0.1.0b2-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b96824ab9a2dcdf415444f8dac9f853b302433483da642d6f0d5484819d7c4c
BLAKE2b-256 checksum
How to use checksums
10f1895bf7ba8ac21d3de70778966cad58f5154d1d2b27ed4bed80e7774a86a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

Security for benzene-grpc 0.1.0b2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for benzene_grpc-0.1.0b2.tar.gz

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 Oct 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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