Skip to main content

Sync and use a networkX graph between multiple hosts through the power of Zenoh storages.

Project description

pre-commit uv Ruff Built with Material for MkDocs


alt text

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.
alt text

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


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)

Uploaded Source

Built Distribution

meshnetworkx-0.1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

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

Hashes for meshnetworkx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3031e626a55699842c74814d856b2417c2ba4718142fd66d03bedfe0f677f553
MD5 9e8b90566defc7168be03569c39c408b
BLAKE2b-256 a9146b56e8c95702427d55e8535143c5bc4f359d76943b044f3811a7ea012014

See more details on using hashes here.

File details

Details for the file meshnetworkx-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for meshnetworkx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9cc791fa074f51a2f018d93a2667c4eb0e396db2d702e0dea914c73915cce27
MD5 7b36d2f6112018e40600a9c430a49ba5
BLAKE2b-256 33f40d5942676276931e4fcbf49e09e11c6eb6658dc77c66c2a353aa6346f9ce

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page