neuronum 1.1.2__py3-none-any.whl → 1.2.0__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/__init__.py +0 -3
- neuronum/neuronum.py +18 -0
- {neuronum-1.1.2.dist-info → neuronum-1.2.0.dist-info}/METADATA +20 -13
- neuronum-1.2.0.dist-info/RECORD +8 -0
- neuronum-1.2.0.dist-info/entry_points.txt +2 -0
- neuronum-1.1.2.dist-info/RECORD +0 -7
- {neuronum-1.1.2.dist-info → neuronum-1.2.0.dist-info}/LICENSE +0 -0
- {neuronum-1.1.2.dist-info → neuronum-1.2.0.dist-info}/WHEEL +0 -0
- {neuronum-1.1.2.dist-info → neuronum-1.2.0.dist-info}/top_level.txt +0 -0
neuronum/__init__.py
CHANGED
neuronum/neuronum.py
CHANGED
|
@@ -2,6 +2,7 @@ import requests
|
|
|
2
2
|
import socket
|
|
3
3
|
from typing import Optional
|
|
4
4
|
import ssl
|
|
5
|
+
from websocket import create_connection
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class Cell:
|
|
@@ -200,5 +201,22 @@ class Cell:
|
|
|
200
201
|
return "Authentication successful" in response
|
|
201
202
|
|
|
202
203
|
|
|
204
|
+
def sync(self, STX: str):
|
|
205
|
+
try:
|
|
206
|
+
ws = create_connection(f"wss://{self.network}/ws/{STX}")
|
|
207
|
+
print(f"Connected to Stream {STX}")
|
|
208
|
+
except Exception as e:
|
|
209
|
+
print(f"Failed to connect: {e}")
|
|
210
|
+
return
|
|
211
|
+
|
|
212
|
+
try:
|
|
213
|
+
while True:
|
|
214
|
+
message = ws.recv()
|
|
215
|
+
print(f"Received Data: {message}")
|
|
216
|
+
except KeyboardInterrupt:
|
|
217
|
+
print("Closing connection...")
|
|
218
|
+
finally:
|
|
219
|
+
ws.close()
|
|
220
|
+
|
|
203
221
|
|
|
204
222
|
__all__ = ['Cell']
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: neuronum
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Interact with the Neuronum Network to build, connect & automate economic data streams
|
|
5
|
+
Home-page: https://github.com/neuronumcybernetics/neuronum
|
|
5
6
|
Author: Neuronum Cybernetics
|
|
6
7
|
Author-email: welcome@neuronum.net
|
|
7
8
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -11,8 +12,10 @@ Requires-Python: >=3.6
|
|
|
11
12
|
Description-Content-Type: text/markdown
|
|
12
13
|
License-File: LICENSE
|
|
13
14
|
Requires-Dist: requests
|
|
15
|
+
Requires-Dist: websocket-client
|
|
14
16
|
|
|
15
17
|

|
|
18
|
+
|
|
16
19
|
[](https://neuronum.net)
|
|
17
20
|
[](https://neuronum.net/docs)
|
|
18
21
|
[](https://www.youtube.com/@neuronumnet)
|
|
@@ -55,10 +58,10 @@ Activate Transmitter (TX):
|
|
|
55
58
|
TX = "id::tx"
|
|
56
59
|
|
|
57
60
|
data = {
|
|
58
|
-
"key1": "value1",
|
|
59
|
-
"key2": "value2",
|
|
60
|
-
"key3": "value3",
|
|
61
|
-
"key4": "value4"
|
|
61
|
+
"key1": "value1",
|
|
62
|
+
"key2": "value2",
|
|
63
|
+
"key3": "value3",
|
|
64
|
+
"key4": "value4"
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
cell.activate(TX, data)
|
|
@@ -68,9 +71,9 @@ Store data on your private Circuit (CTX):
|
|
|
68
71
|
```bash
|
|
69
72
|
label = "your_label"
|
|
70
73
|
data = {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
"key1": "value1",
|
|
75
|
+
"key2": "value2",
|
|
76
|
+
"key3": "value3",
|
|
74
77
|
}
|
|
75
78
|
cell.store(label, data)
|
|
76
79
|
```
|
|
@@ -81,9 +84,9 @@ CTX = "id::ctx"
|
|
|
81
84
|
|
|
82
85
|
label = "your_label"
|
|
83
86
|
data = {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
"key1": "value1",
|
|
88
|
+
"key2": "value2",
|
|
89
|
+
"key3": "value3",
|
|
87
90
|
}
|
|
88
91
|
cell.store(label, data, CTX)
|
|
89
92
|
```
|
|
@@ -96,7 +99,6 @@ data = cell.load(label)
|
|
|
96
99
|
key1 = data["key1"]
|
|
97
100
|
key2 = data["key2"]
|
|
98
101
|
key3 = data["key3"]
|
|
99
|
-
print(key1, key2, key3)
|
|
100
102
|
```
|
|
101
103
|
|
|
102
104
|
Load data from a public Circuit (CTX):
|
|
@@ -109,7 +111,6 @@ data = cell.load(label, CTX)
|
|
|
109
111
|
key1 = data["key1"]
|
|
110
112
|
key2 = data["key2"]
|
|
111
113
|
key3 = data["key3"]
|
|
112
|
-
print(key1, key2, key3)
|
|
113
114
|
```
|
|
114
115
|
|
|
115
116
|
Delete data from your private Circuit (CTX):
|
|
@@ -131,3 +132,9 @@ Stream data:
|
|
|
131
132
|
data = "your_data"
|
|
132
133
|
cell.stream(data)
|
|
133
134
|
```
|
|
135
|
+
|
|
136
|
+
Sync data:
|
|
137
|
+
```bash
|
|
138
|
+
STX = "stx::id"
|
|
139
|
+
cell.sync(STX)
|
|
140
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
2
|
+
neuronum/neuronum.py,sha256=06qogFQ_a3dOqa6dgvLadltcYj8mtnxAqBxsYafB2uU,6746
|
|
3
|
+
neuronum-1.2.0.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
4
|
+
neuronum-1.2.0.dist-info/METADATA,sha256=zEqH8GXUGxlrw5TtQQ4XwLp00TitmlkxscMA0JYd0Nw,3184
|
|
5
|
+
neuronum-1.2.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
6
|
+
neuronum-1.2.0.dist-info/entry_points.txt,sha256=HAUSjcFCB-PSkwnZQy9qEaelZmzS6EmTMjrhPynPKg8,47
|
|
7
|
+
neuronum-1.2.0.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
|
|
8
|
+
neuronum-1.2.0.dist-info/RECORD,,
|
neuronum-1.1.2.dist-info/RECORD
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
neuronum/__init__.py,sha256=P0KTJMGY_eT3l5YzR4LHfl64KH5Qt_qhcrqf9Ld2G00,74
|
|
2
|
-
neuronum/neuronum.py,sha256=gDzg9aN4jjaBnKLLD9YRSvmV1uffKZOBJb8Fv-WDtfM,6186
|
|
3
|
-
neuronum-1.1.2.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
4
|
-
neuronum-1.1.2.dist-info/METADATA,sha256=2deXbg_Q7YsY0apxQhWeNnaX1WKSHWDdy2YJlGHr9-A,3086
|
|
5
|
-
neuronum-1.1.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
6
|
-
neuronum-1.1.2.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
|
|
7
|
-
neuronum-1.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|