neuronum 1.5.0__py3-none-any.whl → 1.5.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 +2 -2
- {neuronum-1.5.0.dist-info → neuronum-1.5.1.dist-info}/METADATA +81 -80
- neuronum-1.5.1.dist-info/RECORD +7 -0
- neuronum-1.5.0.dist-info/RECORD +0 -7
- {neuronum-1.5.0.dist-info → neuronum-1.5.1.dist-info}/LICENSE +0 -0
- {neuronum-1.5.0.dist-info → neuronum-1.5.1.dist-info}/WHEEL +0 -0
- {neuronum-1.5.0.dist-info → neuronum-1.5.1.dist-info}/top_level.txt +0 -0
neuronum/neuronum.py
CHANGED
|
@@ -32,13 +32,13 @@ class Cell:
|
|
|
32
32
|
return "Authentication successful" in response
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
def create_tx(self, descr: str, key_values: dict,
|
|
35
|
+
def create_tx(self, descr: str, key_values: dict, stx: str, label: str, partners: list):
|
|
36
36
|
url = f"https://{self.network}/api/create_tx"
|
|
37
37
|
|
|
38
38
|
TX = {
|
|
39
39
|
"descr": descr,
|
|
40
40
|
"key_values": key_values,
|
|
41
|
-
"
|
|
41
|
+
"stx": stx,
|
|
42
42
|
"label": label,
|
|
43
43
|
"partners": partners,
|
|
44
44
|
"cell": self.to_dict()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: neuronum
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.1
|
|
4
4
|
Summary: Interact with the Neuronum Network to build & automate interconnected networks of soft- and hardware components
|
|
5
5
|
Home-page: https://neuronum.net
|
|
6
6
|
Author: Neuronum Cybernetics
|
|
@@ -14,7 +14,6 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: requests
|
|
16
16
|
Requires-Dist: websocket-client
|
|
17
|
-
Requires-Dist: iota-sdk
|
|
18
17
|
|
|
19
18
|

|
|
20
19
|
|
|
@@ -26,14 +25,16 @@ Requires-Dist: iota-sdk
|
|
|
26
25
|
|
|
27
26
|
## Features
|
|
28
27
|
- **Cell**: Identity to connect and interact with the Neuronum Network
|
|
29
|
-
- **Transmitters (TX)**: Automate economic data transfer
|
|
30
|
-
- **Circuits (CTX)**: Store data in
|
|
28
|
+
- **Transmitters (TX)**: Automate economic data transfer
|
|
29
|
+
- **Circuits (CTX)**: Store data in Key-Value-Label databases
|
|
31
30
|
- **Streams (STX)**: Stream, synchronize and control data in real time
|
|
32
31
|
- **Nodes**: Soft-/Hardware components participating in the Network ecosystem
|
|
33
32
|
|
|
34
33
|
To interact with the Network you will need to create a Neuronum Cell.
|
|
35
34
|
Create your Cell: [Create Cell](https://neuronum.net/createcell)
|
|
36
35
|
|
|
36
|
+
|
|
37
|
+
### Installation & Connection
|
|
37
38
|
Start with installing the Neuronum library using pip:
|
|
38
39
|
```python
|
|
39
40
|
pip install neuronum
|
|
@@ -44,142 +45,142 @@ Configure and test Cell connection:
|
|
|
44
45
|
import neuronum
|
|
45
46
|
|
|
46
47
|
cell = neuronum.Cell(
|
|
47
|
-
host="host::cell",
|
|
48
|
-
password="your_password",
|
|
49
|
-
network="neuronum.net",
|
|
50
|
-
synapse="your_synapse"
|
|
48
|
+
host="host::cell", # cell host
|
|
49
|
+
password="your_password", # cell password
|
|
50
|
+
network="neuronum.net", # cell network
|
|
51
|
+
synapse="your_synapse" # cell synapse
|
|
51
52
|
)
|
|
52
|
-
cell.connect()
|
|
53
|
+
cell.connect() # connect to network
|
|
53
54
|
```
|
|
54
55
|
|
|
55
56
|
### Transmitters (TX)
|
|
56
|
-
Transmitters (TX) are used to create predefined templates to receive and send data in a standardized format.
|
|
57
|
+
Transmitters (TX) are used to create predefined templates to receive and send data in a standardized format.
|
|
57
58
|
|
|
58
59
|
Create Transmitter (TX):
|
|
59
60
|
```python
|
|
60
|
-
descr = "Test Transmitter"
|
|
61
|
-
key_values = {
|
|
61
|
+
descr = "Test Transmitter" # description (max 25 characters)
|
|
62
|
+
key_values = { # defined keys and example values
|
|
62
63
|
"key1": "value1",
|
|
63
64
|
"key2": "value2",
|
|
64
65
|
"key3": "value3",
|
|
65
66
|
}
|
|
66
|
-
|
|
67
|
-
label = "key1:key2"
|
|
68
|
-
partners = ["id::cell", "id::cell"]
|
|
69
|
-
txID = cell.create_tx(descr, key_values,
|
|
67
|
+
stx = "id::stx" # select Stream (STX)
|
|
68
|
+
label = "key1:key2" # label TX data
|
|
69
|
+
partners = ["id::cell", "id::cell"] # authorized Cells
|
|
70
|
+
txID = cell.create_tx(descr, key_values, stx, label, partners) # create TX
|
|
70
71
|
```
|
|
71
72
|
|
|
72
73
|
Activate Transmitter (TX):
|
|
73
74
|
```python
|
|
74
|
-
TX = "id::tx"
|
|
75
|
-
data = {
|
|
75
|
+
TX = "id::tx" # select Transmitter (TX)
|
|
76
|
+
data = { # enter key-values
|
|
76
77
|
"key1": "value1",
|
|
77
78
|
"key2": "value2",
|
|
78
79
|
"key3": "value3",
|
|
79
80
|
}
|
|
80
|
-
cell.activate_tx(TX, data)
|
|
81
|
+
cell.activate_tx(TX, data) # activate TX
|
|
81
82
|
```
|
|
82
83
|
|
|
83
84
|
Delete Transmitter (TX):
|
|
84
85
|
```python
|
|
85
|
-
TX = "id::tx"
|
|
86
|
-
cell.delete_tx(TX)
|
|
86
|
+
TX = "id::tx" # select Transmitter (TX)
|
|
87
|
+
cell.delete_tx(TX) # delete TX
|
|
87
88
|
```
|
|
88
89
|
|
|
89
90
|
List Transmitter (TX) from Cell:
|
|
90
91
|
```python
|
|
91
|
-
cellID = "id::cell"
|
|
92
|
-
txList = cell.list_tx(cellID)
|
|
92
|
+
cellID = "id::cell" # select Cell
|
|
93
|
+
txList = cell.list_tx(cellID) # list Transmitters (TX)
|
|
93
94
|
```
|
|
94
95
|
|
|
95
96
|
### Circuits (CTX)
|
|
96
|
-
Circuits (CTX) store and organize data
|
|
97
|
+
Circuits (CTX) store and organize data using a Key-Value-Label system
|
|
97
98
|
|
|
98
99
|
Create Circuit (CTX):
|
|
99
100
|
```python
|
|
100
|
-
descr = "Test Circuit"
|
|
101
|
-
partners = ["id::cell", "id::cell"]
|
|
102
|
-
ctxID = cell.create_ctx(descr, partners)
|
|
101
|
+
descr = "Test Circuit" # description (max 25 characters)
|
|
102
|
+
partners = ["id::cell", "id::cell"] # authorized Cells
|
|
103
|
+
ctxID = cell.create_ctx(descr, partners) # create Circuit (CTX)
|
|
103
104
|
```
|
|
104
105
|
|
|
105
106
|
Store data on your private Circuit (CTX):
|
|
106
107
|
```python
|
|
107
|
-
label = "your_label"
|
|
108
|
-
data = {
|
|
108
|
+
label = "your_label" # data label (should be unique)
|
|
109
|
+
data = { # data as key-value pairs
|
|
109
110
|
"key1": "value1",
|
|
110
111
|
"key2": "value2",
|
|
111
112
|
"key3": "value3",
|
|
112
113
|
}
|
|
113
|
-
cell.store(label, data)
|
|
114
|
+
cell.store(label, data) # store data
|
|
114
115
|
```
|
|
115
116
|
|
|
116
117
|
Store data on a public Circuit (CTX):
|
|
117
118
|
```python
|
|
118
|
-
CTX = "id::ctx"
|
|
119
|
-
label = "your_label"
|
|
120
|
-
data = {
|
|
119
|
+
CTX = "id::ctx" # select Circuit (CTX
|
|
120
|
+
label = "your_label" # data label (should be unique)
|
|
121
|
+
data = { # data as key-value pairs
|
|
121
122
|
"key1": "value1",
|
|
122
123
|
"key2": "value2",
|
|
123
124
|
"key3": "value3",
|
|
124
125
|
}
|
|
125
|
-
cell.store(label, data, CTX)
|
|
126
|
+
cell.store(label, data, CTX) # store data
|
|
126
127
|
```
|
|
127
128
|
|
|
128
129
|
Load data from your private Circuit (CTX):
|
|
129
130
|
```python
|
|
130
|
-
label = "your_label"
|
|
131
|
-
data = cell.load(label)
|
|
132
|
-
key1 = data["key1"]
|
|
131
|
+
label = "your_label" # select label
|
|
132
|
+
data = cell.load(label) # load data by label
|
|
133
|
+
key1 = data["key1"] # get data from key
|
|
133
134
|
key2 = data["key2"]
|
|
134
135
|
key3 = data["key3"]
|
|
135
|
-
print(key1, key2, key3)
|
|
136
|
+
print(key1, key2, key3) # print data
|
|
136
137
|
```
|
|
137
138
|
|
|
138
139
|
Load data from a public Circuit (CTX):
|
|
139
140
|
```python
|
|
140
|
-
CTX = "id::ctx"
|
|
141
|
-
label = "your_label"
|
|
142
|
-
data = cell.load(label, CTX)
|
|
143
|
-
key1 = data["key1"]
|
|
141
|
+
CTX = "id::ctx" # select Circuit (CTX)
|
|
142
|
+
label = "your_label" # select label
|
|
143
|
+
data = cell.load(label, CTX) # load data by label
|
|
144
|
+
key1 = data["key1"] # get data from key
|
|
144
145
|
key2 = data["key2"]
|
|
145
146
|
key3 = data["key3"]
|
|
146
|
-
print(key1, key2, key3)
|
|
147
|
+
print(key1, key2, key3) # print data
|
|
147
148
|
```
|
|
148
149
|
|
|
149
150
|
Delete data from your private Circuit (CTX):
|
|
150
151
|
```python
|
|
151
|
-
label = "your_label"
|
|
152
|
-
cell.delete(label)
|
|
152
|
+
label = "your_label" # select label
|
|
153
|
+
cell.delete(label) # delete data by label
|
|
153
154
|
```
|
|
154
155
|
|
|
155
156
|
Delete data from a public Circuit (CTX):
|
|
156
157
|
```python
|
|
157
|
-
CTX = "id::ctx"
|
|
158
|
-
label = "your_label"
|
|
159
|
-
cell.delete(label, CTX)
|
|
158
|
+
CTX = "id::ctx" # select Circuits (CTX)
|
|
159
|
+
label = "your_label" # select label
|
|
160
|
+
cell.delete(label, CTX) # delete data by label
|
|
160
161
|
```
|
|
161
162
|
|
|
162
163
|
Clear your private Circuit (CTX):
|
|
163
164
|
```python
|
|
164
|
-
cell.clear()
|
|
165
|
+
cell.clear() # clear Circuit (CTX)
|
|
165
166
|
```
|
|
166
167
|
|
|
167
168
|
Clear Circuit (CTX):
|
|
168
169
|
```python
|
|
169
|
-
CTX = "id::ctx"
|
|
170
|
-
cell.clear(CTX)
|
|
170
|
+
CTX = "id::ctx" # select Circuit (CTX)
|
|
171
|
+
cell.clear(CTX) # clear CTX
|
|
171
172
|
```
|
|
172
173
|
|
|
173
174
|
Delete Circuit (CTX):
|
|
174
175
|
```python
|
|
175
|
-
CTX = "id::ctx"
|
|
176
|
-
cell.delete_ctx(CTX)
|
|
176
|
+
CTX = "id::ctx" # select Circuit (CTX)
|
|
177
|
+
cell.delete_ctx(CTX) # delete CTX
|
|
177
178
|
```
|
|
178
179
|
|
|
179
180
|
List Circuits (CTX) from Cell:
|
|
180
181
|
```python
|
|
181
|
-
cellID = "id::cell"
|
|
182
|
-
ctxList = cell.list_ctx(cellID)
|
|
182
|
+
cellID = "id::cell" # select Cell
|
|
183
|
+
ctxList = cell.list_ctx(cellID) # list Circuits (CTX)
|
|
183
184
|
```
|
|
184
185
|
|
|
185
186
|
### Streams (STX)
|
|
@@ -187,39 +188,39 @@ Streams (STX) facilitate real-time data synchronization and interaction, ensurin
|
|
|
187
188
|
|
|
188
189
|
Create Stream (STX):
|
|
189
190
|
```python
|
|
190
|
-
descr = "Test Stream"
|
|
191
|
-
partners = ["id::cell", "id::cell"]
|
|
192
|
-
stxID = cell.create_stx(descr, partners)
|
|
191
|
+
descr = "Test Stream" # description (max 25 characters)
|
|
192
|
+
partners = ["id::cell", "id::cell"] # authorized Cells
|
|
193
|
+
stxID = cell.create_stx(descr, partners) # create Stream (STX)
|
|
193
194
|
```
|
|
194
195
|
|
|
195
196
|
Stream data to your private Stream (STX):
|
|
196
197
|
```python
|
|
197
|
-
label = "your_label"
|
|
198
|
-
data = {
|
|
198
|
+
label = "your_label" # data label
|
|
199
|
+
data = { # data as key-value pairs
|
|
199
200
|
"key1": "value1",
|
|
200
201
|
"key2": "value2",
|
|
201
202
|
"key3": "value3",
|
|
202
203
|
}
|
|
203
|
-
cell.stream(label, data)
|
|
204
|
+
cell.stream(label, data) # stream data
|
|
204
205
|
```
|
|
205
206
|
|
|
206
207
|
Stream data to a public Stream (STX):
|
|
207
208
|
```python
|
|
208
|
-
STX = "id::stx"
|
|
209
|
-
label = "your_label"
|
|
210
|
-
data = {
|
|
209
|
+
STX = "id::stx" # select Stream (STX)
|
|
210
|
+
label = "your_label" # data label
|
|
211
|
+
data = { # data as key-value pairs
|
|
211
212
|
"key1": "value1",
|
|
212
213
|
"key2": "value2",
|
|
213
214
|
"key3": "value3",
|
|
214
215
|
}
|
|
215
|
-
cell.stream(label, data, STX)
|
|
216
|
+
cell.stream(label, data, STX) # stream data
|
|
216
217
|
```
|
|
217
218
|
|
|
218
219
|
Sync data from your private Stream (STX):
|
|
219
220
|
```python
|
|
220
|
-
stream = cell.sync()
|
|
221
|
-
for operation in stream:
|
|
222
|
-
label = operation.get("label")
|
|
221
|
+
stream = cell.sync() # synchronize Stream (STX)
|
|
222
|
+
for operation in stream: # load stream operations
|
|
223
|
+
label = operation.get("label") # get the operation details by key
|
|
223
224
|
key1 = operation.get("data").get("key1")
|
|
224
225
|
key2 = operation.get("data").get("key2")
|
|
225
226
|
key3 = operation.get("data").get("key3")
|
|
@@ -230,10 +231,10 @@ for operation in stream: # load s
|
|
|
230
231
|
|
|
231
232
|
Sync data from a public Stream (STX):
|
|
232
233
|
```python
|
|
233
|
-
STX = "id::stx"
|
|
234
|
-
stream = cell.sync(STX)
|
|
235
|
-
for operation in stream:
|
|
236
|
-
label = operation.get("label")
|
|
234
|
+
STX = "id::stx" # select Stream (STX)
|
|
235
|
+
stream = cell.sync(STX) # synchronize Stream (STX)
|
|
236
|
+
for operation in stream: # load stream operations
|
|
237
|
+
label = operation.get("label") # get the operation details by key
|
|
237
238
|
key1 = operation.get("data").get("key1")
|
|
238
239
|
key2 = operation.get("data").get("key2")
|
|
239
240
|
key3 = operation.get("data").get("key3")
|
|
@@ -244,8 +245,8 @@ for operation in stream: # load s
|
|
|
244
245
|
|
|
245
246
|
List Streams (STX) from Cell:
|
|
246
247
|
```python
|
|
247
|
-
cellID = "id::cell"
|
|
248
|
-
stxList = cell.list_stx(cellID)
|
|
248
|
+
cellID = "id::cell" # select Cell
|
|
249
|
+
stxList = cell.list_stx(cellID) # list Streams (STX)
|
|
249
250
|
```
|
|
250
251
|
|
|
251
252
|
### Nodes
|
|
@@ -253,14 +254,14 @@ Neuronum Nodes are computing hardware running the Neuronum Client Library, enabl
|
|
|
253
254
|
|
|
254
255
|
Register a Node with its associated Stream (STX):
|
|
255
256
|
```python
|
|
256
|
-
descr = "node_name"
|
|
257
|
-
mode = "public"
|
|
258
|
-
STX = "id::stx"
|
|
259
|
-
nodeID = cell.register_node(descr, mode, STX)
|
|
257
|
+
descr = "node_name" # description (max 25 characters)
|
|
258
|
+
mode = "public" # "public" or "private" Node
|
|
259
|
+
STX = "id::stx" # select Stream (STX)
|
|
260
|
+
nodeID = cell.register_node(descr, mode, STX) # register Node
|
|
260
261
|
```
|
|
261
262
|
|
|
262
263
|
Delete Node:
|
|
263
264
|
```python
|
|
264
|
-
nodeID = "id::node"
|
|
265
|
-
cell.delete_node(nodeID)
|
|
265
|
+
nodeID = "id::node" # select Node
|
|
266
|
+
cell.delete_node(nodeID) # delete Node
|
|
266
267
|
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
2
|
+
neuronum/neuronum.py,sha256=AL0zXiULx-R-Co4XyYtL0lF-z7GGqXGXDxQEYgithPY,14363
|
|
3
|
+
neuronum-1.5.1.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
4
|
+
neuronum-1.5.1.dist-info/METADATA,sha256=H3UZ6u7BHgUcngCTf_0xDwcHjIR1EBlazKe38rXkqnc,11212
|
|
5
|
+
neuronum-1.5.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
6
|
+
neuronum-1.5.1.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
|
|
7
|
+
neuronum-1.5.1.dist-info/RECORD,,
|
neuronum-1.5.0.dist-info/RECORD
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
2
|
-
neuronum/neuronum.py,sha256=BymDHznUPI3mD09mquEbVODFMWiBaxNHYOst4-qDxZ8,14363
|
|
3
|
-
neuronum-1.5.0.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
4
|
-
neuronum-1.5.0.dist-info/METADATA,sha256=9s6uAwEgWSVAM0FwIwayvuskht2myPMUeGXEMgxV8ew,11764
|
|
5
|
-
neuronum-1.5.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
6
|
-
neuronum-1.5.0.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
|
|
7
|
-
neuronum-1.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|