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.0.tar.gz
(14.8 kB
view details)
Built Distribution
File details
Details for the file meshnetworkx-0.1.0.tar.gz
.
File metadata
- Download URL: meshnetworkx-0.1.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.28
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3031e626a55699842c74814d856b2417c2ba4718142fd66d03bedfe0f677f553 |
|
MD5 | 9e8b90566defc7168be03569c39c408b |
|
BLAKE2b-256 | a9146b56e8c95702427d55e8535143c5bc4f359d76943b044f3811a7ea012014 |
File details
Details for the file meshnetworkx-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: meshnetworkx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.28
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9cc791fa074f51a2f018d93a2667c4eb0e396db2d702e0dea914c73915cce27 |
|
MD5 | 7b36d2f6112018e40600a9c430a49ba5 |
|
BLAKE2b-256 | 33f40d5942676276931e4fcbf49e09e11c6eb6658dc77c66c2a353aa6346f9ce |