A tool to distribute the state of a network device to other devices on the network
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Distributed State Network
A Python framework for building distributed applications where nodes automatically share state without explicit data requests.
Why DSN?
Traditional distributed systems require constant polling or complex pub/sub mechanisms to share state between nodes. DSN solves this by providing:
- Automatic state synchronization - Changes propagate instantly across the network
- No single point of failure - Every node maintains its own state
- Simple key-value interface - Read any node's data as easily as local variables
- Complete Security - Triple-layer encryption protects your network
Perfect for building distributed monitoring systems, IoT networks, or any application where multiple machines need to share state efficiently.
Installation
pip install distributed-state-network
Quick Start
1. Create Your First Node
The simplest DSN network is a single node:
from distributed_state_network import DSNodeServer, DSNodeConfig
# Start a node
node = DSNodeServer.start(DSNodeConfig(
node_id="my_first_node",
port=8000,
bootstrap_nodes=[] # Empty for the first node
))
# Write some data
node.node.update_data("status", "online")
node.node.update_data("temperature", "72.5")
How It Works
DSN creates a peer-to-peer network where each node maintains its own state database:
Key concepts:
- Each node owns its state and is the only one who can modify it
- State changes are automatically broadcast to all connected nodes
- Any node can read any other node's state instantly
- All communication is encrypted with AES
Example: Distributed Temperature Monitoring
Create a network of temperature sensors that share readings:
# On each Raspberry Pi with a sensor:
sensor_node = DSNodeServer.start(DSNodeConfig(
node_id=f"sensor_{location}",
port=8000,
bootstrap_nodes=[{"address": "coordinator.local", "port": 8000}]
))
# Continuously update temperature
while True:
temp = read_temperature_sensor()
sensor_node.node.update_data("temperature", str(temp))
sensor_node.node.update_data("timestamp", str(time.time()))
time.sleep(60)
On the monitoring station:
for node_id in monitor.node.peers():
if node_id.startswith("sensor_"):
temp = monitor.node.read_data(node_id, "temperature")
print(f"{node_id}: {temp}°F")
Documentation
API Reference
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file distributed_state_network-0.5.6.tar.gz.
File metadata
- Download URL: distributed_state_network-0.5.6.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
376ffd87dfa3122f3d2b8509a5a9f0717577473c848c9e2065c6409fed6c810f
|
|
| MD5 |
75c8b9ae5eaf08eaf8fbecb27e3f31e7
|
|
| BLAKE2b-256 |
76d9d5c983f213c0c88327d49ef473779997144e4a96688681afe3fadd18c0f6
|
Provenance
The following attestation bundles were made for distributed_state_network-0.5.6.tar.gz:
Publisher:
publish.yml on erinclemmer/distributed_state_network
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
distributed_state_network-0.5.6.tar.gz -
Subject digest:
376ffd87dfa3122f3d2b8509a5a9f0717577473c848c9e2065c6409fed6c810f - Sigstore transparency entry: 779875224
- Sigstore integration time:
-
Permalink:
erinclemmer/distributed_state_network@43acd1b365d7164281e81ec4fb235177f22a60e2 -
Branch / Tag:
refs/tags/0.5.6 - Owner: https://github.com/erinclemmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43acd1b365d7164281e81ec4fb235177f22a60e2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file distributed_state_network-0.5.6-py3-none-any.whl.
File metadata
- Download URL: distributed_state_network-0.5.6-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8b201838ec4f9d4c3705f78b2228890f6bf152ac9e36e797bb1f9e57eddc26e
|
|
| MD5 |
d5332546c37170b4c53538ffe2fd1c12
|
|
| BLAKE2b-256 |
68bb91c8548736107fe663ba45b27dfbf3785204c178c387a24d76ab4ec9a942
|
Provenance
The following attestation bundles were made for distributed_state_network-0.5.6-py3-none-any.whl:
Publisher:
publish.yml on erinclemmer/distributed_state_network
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
distributed_state_network-0.5.6-py3-none-any.whl -
Subject digest:
b8b201838ec4f9d4c3705f78b2228890f6bf152ac9e36e797bb1f9e57eddc26e - Sigstore transparency entry: 779875226
- Sigstore integration time:
-
Permalink:
erinclemmer/distributed_state_network@43acd1b365d7164281e81ec4fb235177f22a60e2 -
Branch / Tag:
refs/tags/0.5.6 - Owner: https://github.com/erinclemmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43acd1b365d7164281e81ec4fb235177f22a60e2 -
Trigger Event:
release
-
Statement type: