pamoja-zenoh
Zenoh key expressions: validity, canonical form, and wildcard matching. One capability of pamoja, one memory-safe Rust core with bindings for TypeScript, Python, and C#.
Install
pip install pamoja-zenoh
from pamoja import zenoh
This pulls in pamoja-native, the compiled engine. pip install pamoja is the whole framework in one package.
Example
The script the test suite runs, spliced here as it ran.
From bindings/python/guides/zenoh.py:
from pamoja.zenoh import canonize, is_canon, is_valid, matches
# A key expression names a set of keys. `*` stands for exactly one chunk, so this selects
# the battery of any node, and not a battery nested deeper.
any_node = "fleet/*/battery"
for key in ("fleet/n7/battery", "fleet/n7/rack/battery"):
print(f"{any_node} covers {key}: {matches(any_node, key)}")
# `**` stands for any number of chunks, including none, which is what a subscription
# covering a whole subtree wants.
print(f"fleet/** covers a nested key: {matches('fleet/**', 'fleet/n7/rack/battery')}")
print(f"fleet/**/battery covers fleet/battery: {matches('fleet/**/battery', 'fleet/battery')}")
# Two expressions that select the same keys have one canonical form. Comparing or routing
# on the written form would treat these as different subscriptions.
written = "fleet/**/**/battery"
canonical = canonize(written)
print(f"{written} is canonical: {is_canon(written)}, and canonizes to {canonical}")
# A malformed expression is rejected rather than canonized into something plausible.
malformed = "fleet//battery"
print(f"{malformed} is valid: {is_valid(malformed)}, canonizes to {canonize(malformed)}")
The same capability in every language
| Language | Package | Reference |
|---|---|---|
| Rust | pamoja-zenoh |
reference, docs.rs, install |
| TypeScript | @pamoja/zenoh |
reference, install |
| Python | pamoja-zenoh |
reference, install |
| C# | Pamoja.Zenoh |
reference, install |
Documentation
pamoja.zenohreference, every class and function in this module.- The Zenoh keys guide, with the same example in Rust, TypeScript, and C#.
- Every capability, and the install page.
License
MIT
Release files for pamoja-zenoh 0.1.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pamoja_zenoh-0.1.18.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pamoja_zenoh-0.1.18-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / pamoja_zenoh-0.1.18.tar.gz
| Download URL | pamoja_zenoh-0.1.18.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32dc7ea0788284fb7587d9609ed7ffadd04453b3b931cbb49e18d8fca7ccbf95
|
|
BLAKE2b-256 checksum How to use checksums |
6db93fa518e6fcfe2023f6fc1d6d0c235322bdd57d3eb23ef0ecb07a765a3558
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / pamoja_zenoh-0.1.18-py3-none-any.whl
| Download URL | pamoja_zenoh-0.1.18-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bbb9d086c15771900f064db12dae0d0745de61de8d058e15d6e6ec55c7166e18
|
|
BLAKE2b-256 checksum How to use checksums |
d0800cb09a13c4ecb6da152109a412601919adeb409022a5eea907a30fec800f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|