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.2.tar.gz
(14.9 kB
view details)
Built Distribution
File details
Details for the file meshnetworkx-0.1.2.tar.gz
.
File metadata
- Download URL: meshnetworkx-0.1.2.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 | 79764e2cd05e5691b39b7a4827e2552121b652ef1c589a413b728565b6a7ec49 |
|
MD5 | ec1ff124db23b23c8f9ce404d108a466 |
|
BLAKE2b-256 | 320e3fc7a2f77d5aa5fe16cd76c2dbacec9e9c356fd081481ed1f01de3aefcf5 |
File details
Details for the file meshnetworkx-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: meshnetworkx-0.1.2-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 | bab37d84d7037915f739ccf56abe2628b373402471ffff083e0db30966de6088 |
|
MD5 | 1115995323ce5e780061aa8199171398 |
|
BLAKE2b-256 | 126bfb182300e74a7c0a1e648c2960354036d5113d6fba58bf3558e1d6b2513e |