Python bindings for zenoh-plugin-grpc
Project description
zenoh-grpc-python
Python bindings for zenoh-plugin-grpc.
Install
From this directory:
maturin develop
Or build a wheel:
maturin build
Or simply pip install:
pip install -e .
Start A Server First
Use either:
cargo run -p zenoh-bridge-grpc
or zenohd with the plugin loaded.
Minimal Example
import zenoh_grpc
with zenoh_grpc.Session.connect() as session:
pub = session.declare_publisher("demo/example", encoding="text/plain")
pub.put(b"hello", encoding="text/plain")
Session.connect() defaults to unix:///tmp/zenoh-grpc.sock, so the shortest form is:
with zenoh_grpc.Session.connect() as session:
...
Python-Style Optional Parameters
The binding keeps Python-style direct function calls and exposes extra gRPC options as optional keyword arguments. If you omit them, the plugin now falls back to Zenoh's native defaults instead of hard-coded wrapper defaults.
put/delete/reply* calls are enqueue-style: success means the request entered a local bounded queue. Slow receivers are also isolated behind local bounded queues, and when a queue is full the oldest item is dropped. Subscriber.dropped_count(), QueryStream.dropped_count(), ReplyStream.dropped_count(), Publisher.send_dropped_count(), and Queryable.send_dropped_count() expose those counters.
declare_subscriber(key_expr, callback=None, ...) and declare_queryable(key_expr, callback=None, ...) support inline callbacks. When a callback is provided, the binding runs it on a dedicated OS thread for that object and acquires the GIL for each event. Callback mode is exclusive with manual receive APIs. Queryables expose receiver() for pull mode, yielding a QueryStream that produces Query objects, and Session.get() / Querier.get() return iterable ReplyStream objects.
After replying to a query, call query.drop() when you are done, or use with receiver.recv() as query: so the query is finalized automatically on context-manager exit.
import zenoh_grpc
with zenoh_grpc.Session.connect() as session:
pub = session.declare_publisher(
"demo/example",
encoding="text/plain",
express=True,
)
pub.put(b"hello", encoding="text/plain")
for reply in session.get("demo/example", timeout_ms=3000):
if reply.ok:
print(reply.sample.key_expr, reply.sample.payload)
Supported endpoint formats:
unix:///tmp/zenoh-grpc.socktcp://127.0.0.1:7335
Examples
See:
examples/pub.pyexamples/sub.pyexamples/sub_callback.pyexamples/queryable.pyexamples/queryable_callback.pyexamples/querier.pyexamples/get.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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 zenoh_grpc-1.7.2.dev2026042701.tar.gz.
File metadata
- Download URL: zenoh_grpc-1.7.2.dev2026042701.tar.gz
- Upload date:
- Size: 44.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bca39415170b1872a3236aaeea04add22632fbeef2ddb0d89755946a71fde54f
|
|
| MD5 |
0d2c3df28a58df731ed414342747b242
|
|
| BLAKE2b-256 |
0a5220a8845e4bcc193bfeb6c74eabc3e64e60f1ef00194bc58dc6b923e7c044
|
Provenance
The following attestation bundles were made for zenoh_grpc-1.7.2.dev2026042701.tar.gz:
Publisher:
nightly-build.yml on shupx/zenoh-plugin-grpc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zenoh_grpc-1.7.2.dev2026042701.tar.gz -
Subject digest:
bca39415170b1872a3236aaeea04add22632fbeef2ddb0d89755946a71fde54f - Sigstore transparency entry: 1394674763
- Sigstore integration time:
-
Permalink:
shupx/zenoh-plugin-grpc@be6360bc5f5d947927d9cdc74493f9eda4e93feb -
Branch / Tag:
refs/heads/master - Owner: https://github.com/shupx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
nightly-build.yml@be6360bc5f5d947927d9cdc74493f9eda4e93feb -
Trigger Event:
schedule
-
Statement type:
File details
Details for the file zenoh_grpc-1.7.2.dev2026042701-cp38-abi3-manylinux_2_31_x86_64.whl.
File metadata
- Download URL: zenoh_grpc-1.7.2.dev2026042701-cp38-abi3-manylinux_2_31_x86_64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.8+, manylinux: glibc 2.31+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
954788957a1ca3f76befadf0e9d0f72defa88d562ed729df3a13dc4162e8c5d1
|
|
| MD5 |
49d742ee47b77b4167b4c951cfa9dafe
|
|
| BLAKE2b-256 |
d51e4fbaee3a9be8a6c65b1424baad3addb127cd82c4a0a10296cbabf510f23f
|
Provenance
The following attestation bundles were made for zenoh_grpc-1.7.2.dev2026042701-cp38-abi3-manylinux_2_31_x86_64.whl:
Publisher:
nightly-build.yml on shupx/zenoh-plugin-grpc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zenoh_grpc-1.7.2.dev2026042701-cp38-abi3-manylinux_2_31_x86_64.whl -
Subject digest:
954788957a1ca3f76befadf0e9d0f72defa88d562ed729df3a13dc4162e8c5d1 - Sigstore transparency entry: 1394674802
- Sigstore integration time:
-
Permalink:
shupx/zenoh-plugin-grpc@be6360bc5f5d947927d9cdc74493f9eda4e93feb -
Branch / Tag:
refs/heads/master - Owner: https://github.com/shupx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
nightly-build.yml@be6360bc5f5d947927d9cdc74493f9eda4e93feb -
Trigger Event:
schedule
-
Statement type:
File details
Details for the file zenoh_grpc-1.7.2.dev2026042701-cp38-abi3-manylinux_2_31_aarch64.whl.
File metadata
- Download URL: zenoh_grpc-1.7.2.dev2026042701-cp38-abi3-manylinux_2_31_aarch64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.8+, manylinux: glibc 2.31+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24773fe8a9008492c42d989148563690fd4f0fd14ea08cf7098ff8951e2599e3
|
|
| MD5 |
ed9eb09470a0a77311d20973e8982e67
|
|
| BLAKE2b-256 |
ad35bbc4fc79768a31d4e443b4250d34987cd8d796ceb23188ef261fbeb366ff
|
Provenance
The following attestation bundles were made for zenoh_grpc-1.7.2.dev2026042701-cp38-abi3-manylinux_2_31_aarch64.whl:
Publisher:
nightly-build.yml on shupx/zenoh-plugin-grpc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zenoh_grpc-1.7.2.dev2026042701-cp38-abi3-manylinux_2_31_aarch64.whl -
Subject digest:
24773fe8a9008492c42d989148563690fd4f0fd14ea08cf7098ff8951e2599e3 - Sigstore transparency entry: 1394674837
- Sigstore integration time:
-
Permalink:
shupx/zenoh-plugin-grpc@be6360bc5f5d947927d9cdc74493f9eda4e93feb -
Branch / Tag:
refs/heads/master - Owner: https://github.com/shupx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
nightly-build.yml@be6360bc5f5d947927d9cdc74493f9eda4e93feb -
Trigger Event:
schedule
-
Statement type: