neuronum 1.3.4__py3-none-any.whl → 1.4.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of neuronum might be problematic. Click here for more details.

neuronum/neuronum.py CHANGED
@@ -59,6 +59,38 @@ class Cell:
59
59
 
60
60
 
61
61
 
62
+ def register(self, node: str, mode: str, stx: str):
63
+ if mode == "public":
64
+ url = f"https://{self.network}/register/node/public"
65
+ elif mode == "private":
66
+ url = f"https://{self.network}/register/node/private"
67
+ else:
68
+ return {"error": "Invalid mode", "message": "Mode has to be 'public' or 'private'"}
69
+
70
+ node_data = {
71
+ "name": node,
72
+ "mode": mode,
73
+ "stream": stx,
74
+ "cell": self.to_dict()
75
+ }
76
+
77
+ try:
78
+ response = requests.post(
79
+ url,
80
+ json=node_data,
81
+ )
82
+
83
+ response.raise_for_status()
84
+
85
+ print(f"Response from Neuronum: {response.json()}")
86
+
87
+ except requests.exceptions.RequestException as e:
88
+ print(f"Error sending request: {e}")
89
+ except Exception as e:
90
+ print(f"Unexpected error: {e}")
91
+
92
+
93
+
62
94
  def test_connection(self):
63
95
  url = f"https://{self.network}/testConnection"
64
96
 
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neuronum
3
- Version: 1.3.4
4
- Summary: Interact with the Neuronum Network to build, connect & automate economic data streams
3
+ Version: 1.4.1
4
+ Summary: Interact with the Neuronum Network to build, connect & automate real-time data streams
5
5
  Home-page: https://neuronum.net
6
6
  Author: Neuronum Cybernetics
7
7
  Author-email: welcome@neuronum.net
@@ -21,12 +21,13 @@ Requires-Dist: websocket-client
21
21
  [![Documentation](https://img.shields.io/badge/Docs-Read%20now-green)](https://github.com/neuronumcybernetics/neuronum)
22
22
  [![Tutorials](https://img.shields.io/badge/Tutorials-Watch%20now-red)](https://www.youtube.com/@neuronumnet)
23
23
 
24
- Interact with the `Neuronum Network` to build, connect & automate economic data streams.
24
+ Interact with the `Neuronum Network` to build, connect & automate real-time data streams.
25
25
 
26
26
  ## Cell Features
27
27
  - **Transmitters (TX)**: Automate economic data transfer + Circuits Integration
28
28
  - **Circuits (CTX)**: A simple Key-Value-Label database to store economic data
29
29
  - **Streams (STX)**: Stream, synchronize and control data in real time
30
+ - **Nodes**: Register hardware nodes actively streaming real-time data into the network
30
31
 
31
32
  ## Getting Started
32
33
  Create your Neuronum Cell: [Create Cell](https://neuronum.net/createcell)
@@ -175,3 +176,20 @@ for operation in stream:
175
176
  operator = operation.get("operator")
176
177
  ```
177
178
 
179
+ ### Nodes
180
+ Register a public Node with its associated Stream (STX):
181
+ ```bash
182
+ node = "node_name" # Unique node name
183
+ mode = "public"
184
+ STX = "id::stx"
185
+ cell.register(node, mode, STX)
186
+ ```
187
+
188
+ Register a private Node with its associated Stream (STX):
189
+ ```bash
190
+ node = "node_name" # Unique node name
191
+ mode = "private"
192
+ STX = "id::stx"
193
+ cell.register(node, mode, STX)
194
+ ```
195
+
@@ -0,0 +1,7 @@
1
+ neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
2
+ neuronum/neuronum.py,sha256=X5peM3ZOK7MJU-zS8GeqBC2vBu-weAJgCfzQ48I3FvI,8908
3
+ neuronum-1.4.1.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
4
+ neuronum-1.4.1.dist-info/METADATA,sha256=lg-qZ407i0vZsj4BNVR7X8_keos82I4r7pnzMVjwjwc,4590
5
+ neuronum-1.4.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
6
+ neuronum-1.4.1.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
7
+ neuronum-1.4.1.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
2
- neuronum/neuronum.py,sha256=PSzSYL3ig0WATo0hzswk3v4Gdk_0eZVho3L9xte0gZ0,7960
3
- neuronum-1.3.4.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
4
- neuronum-1.3.4.dist-info/METADATA,sha256=AqO3cYQcRQlDq5wr8-VC6wzHF-9CZk55N_DCKuar8sk,4122
5
- neuronum-1.3.4.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
6
- neuronum-1.3.4.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
7
- neuronum-1.3.4.dist-info/RECORD,,