Sync and use a networkX graph between multiple hosts through the power of Zenoh storages.
Project description
MeshNetworkX
Networkx Graphs synced across devices using Zenoh.
Explore the docs »
Report Bug
·
Request Feature
Quickstart
- run
zenohd -c .zenoh_docker/zenoh-myhome.json5
to create a storage - or
docker compose up zenoh-host
to create a storage.
then run the following pip install -e ".[examples]"
to install the package.
Then run an example with python examples/main.py
Why?
- If you model your application domain as a graph, this package makes it easy to run on multiple devices and automatically sync the graph between them.
- It is a drop-in replacement for networkx, so you can use all the networkx methods on the graph.
How?
- It is an abstraction on top of the Zenoh protocol, which is a very efficient protocol for IoT applications.
- The graph is stored in a zenoh storage, for more information on how zenoh keeps storages alligned (even if the network becomes partitioned and then later reconnects), check here.
Example
Assuming:
- you have two devices, and you want to create a graph on one device and access it on the other device.
- you have a zenoh storage running on both devices.
- Both devices can find each other using zenoh discovery (local network or using a Zenoh Router).
On device one:
import meshnetworkx as mx
G = mx.Graph()
G.add_node(1, color="red")
G.add_edge(1, 2, color="pink")
After that on device two:
import meshnetworkx as mx
G = mx.Graph()
print(G.nodes(data=True))
>>> [(1, {'color': 'red'}), (2, {})]
print(G.edges(data=True))
>>> [(1, 2, {'color': 'pink'})]
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
meshnetworkx-0.1.1.tar.gz
(14.9 kB
view details)
Built Distribution
File details
Details for the file meshnetworkx-0.1.1.tar.gz
.
File metadata
- Download URL: meshnetworkx-0.1.1.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.28
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a3301c0b991048f67aea61d17202ac7fe1b21fefe51eca7cd8d4baf2767eabd |
|
MD5 | 7b9e6c3f264fe470c7935adc92ae7a4f |
|
BLAKE2b-256 | 2566b7d20a09a61f01c5d4fafab6b3d66dff181f5049520ba7ca723e4ec084d2 |
File details
Details for the file meshnetworkx-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: meshnetworkx-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.28
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 709b2c4b6b8b289ca0b832fbe0e398e1e03315f0cade88f410ffff2f47c2dca0 |
|
MD5 | 43318f0134970e92bf389d79e4368489 |
|
BLAKE2b-256 | 41d5b0c03e37ec378940d3dce3ab566dff5cbc249481b5a07abb5695ed013bd3 |