neuronum 1.5.0__tar.gz → 1.6.0__tar.gz
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-1.5.0 → neuronum-1.6.0}/PKG-INFO +165 -99
- {neuronum-1.5.0 → neuronum-1.6.0}/README.md +161 -97
- neuronum-1.6.0/cli/__init__.py +0 -0
- neuronum-1.6.0/cli/main.py +341 -0
- {neuronum-1.5.0 → neuronum-1.6.0}/neuronum/neuronum.py +150 -75
- {neuronum-1.5.0 → neuronum-1.6.0}/neuronum.egg-info/PKG-INFO +165 -99
- {neuronum-1.5.0 → neuronum-1.6.0}/neuronum.egg-info/SOURCES.txt +3 -0
- neuronum-1.6.0/neuronum.egg-info/entry_points.txt +2 -0
- neuronum-1.6.0/neuronum.egg-info/requires.txt +5 -0
- {neuronum-1.5.0 → neuronum-1.6.0}/neuronum.egg-info/top_level.txt +1 -0
- {neuronum-1.5.0 → neuronum-1.6.0}/setup.py +9 -2
- neuronum-1.5.0/neuronum.egg-info/requires.txt +0 -3
- {neuronum-1.5.0 → neuronum-1.6.0}/LICENSE +0 -0
- {neuronum-1.5.0 → neuronum-1.6.0}/neuronum/__init__.py +0 -0
- {neuronum-1.5.0 → neuronum-1.6.0}/neuronum.egg-info/dependency_links.txt +0 -0
- {neuronum-1.5.0 → neuronum-1.6.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: neuronum
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.0
|
|
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,172 +14,207 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: requests
|
|
16
16
|
Requires-Dist: websocket-client
|
|
17
|
-
Requires-Dist:
|
|
17
|
+
Requires-Dist: click
|
|
18
|
+
Requires-Dist: questionary
|
|
19
|
+
Requires-Dist: python-dotenv
|
|
18
20
|
|
|
19
21
|

|
|
20
22
|
|
|
21
|
-
[](https://neuronum.net)
|
|
22
|
-
[](https://github.com/neuronumcybernetics/neuronum)
|
|
23
|
-
[](https://www.youtube.com/@neuronumnet)
|
|
23
|
+
[](https://neuronum.net) [](https://github.com/neuronumcybernetics/neuronum)
|
|
24
24
|
|
|
25
25
|
`Neuronum` is a cybernetic framework enabling businesses to build & automate interconnected networks of soft- and hardware components
|
|
26
26
|
|
|
27
27
|
## Features
|
|
28
28
|
- **Cell**: Identity to connect and interact with the Neuronum Network
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
29
|
+
- **Nodes/Node-CLI**: Setup and manage Neuronum Nodes from the command line.
|
|
30
|
+
- **Transmitters (TX)**: Automate economic data transfer
|
|
31
|
+
- **Circuits (CTX)**: Store data in Key-Value-Label databases
|
|
31
32
|
- **Streams (STX)**: Stream, synchronize and control data in real time
|
|
32
|
-
- **
|
|
33
|
+
- **Contracts/Tokens**: Automate contract-based authorization between Nodes and Cells
|
|
33
34
|
|
|
34
|
-
To interact with the Network you will need to create a Neuronum Cell.
|
|
35
|
-
Create your Cell: [Create Cell](https://neuronum.net/createcell)
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
### Installation
|
|
37
|
+
Install the Neuronum library using pip:
|
|
38
38
|
```python
|
|
39
39
|
pip install neuronum
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
### Cell
|
|
43
|
+
To interact with the Network you will need to create a Neuronum Cell.
|
|
44
|
+
Create your Cell: [Create Cell](https://neuronum.net/createcell)
|
|
45
|
+
|
|
46
|
+
Set and test Cell connection:
|
|
43
47
|
```python
|
|
44
48
|
import neuronum
|
|
45
49
|
|
|
46
50
|
cell = neuronum.Cell(
|
|
47
|
-
host="host::cell",
|
|
48
|
-
password="your_password",
|
|
49
|
-
network="neuronum.net",
|
|
50
|
-
synapse="your_synapse"
|
|
51
|
+
host="host::cell", # cell host
|
|
52
|
+
password="your_password", # cell password
|
|
53
|
+
network="neuronum.net", # cell network
|
|
54
|
+
synapse="your_synapse" # cell synapse
|
|
51
55
|
)
|
|
52
|
-
cell.connect()
|
|
56
|
+
cell.connect() # connect to network
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Nodes/Node-CLI
|
|
60
|
+
Neuronum Nodes are computing hardware powered by the Neuronum library, enabling seamless communication between Nodes and Cells.
|
|
61
|
+
|
|
62
|
+
Initialize your Node:
|
|
63
|
+
```bash
|
|
64
|
+
>>> neuronum init-node
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Start your Node:
|
|
68
|
+
```bash
|
|
69
|
+
>>> neuronum start-node
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Stop your Node:
|
|
73
|
+
```bash
|
|
74
|
+
>>> neuronum stop-node
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Register your Node on the Neuronum Network:
|
|
78
|
+
```bash
|
|
79
|
+
>>> neuronum register-node
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Update your Node:
|
|
83
|
+
```bash
|
|
84
|
+
>>> neuronum update-node
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Delete your Node:
|
|
88
|
+
```bash
|
|
89
|
+
>>> neuronum delete-node
|
|
53
90
|
```
|
|
54
91
|
|
|
55
92
|
### Transmitters (TX)
|
|
56
|
-
Transmitters (TX) are used to create predefined templates to receive and send data in a standardized format.
|
|
93
|
+
Transmitters (TX) are used to create predefined templates to receive and send data in a standardized format.
|
|
57
94
|
|
|
58
95
|
Create Transmitter (TX):
|
|
59
96
|
```python
|
|
60
|
-
descr = "Test Transmitter"
|
|
61
|
-
key_values = {
|
|
97
|
+
descr = "Test Transmitter" # description (max 25 characters)
|
|
98
|
+
key_values = { # defined keys and example values
|
|
62
99
|
"key1": "value1",
|
|
63
100
|
"key2": "value2",
|
|
64
101
|
"key3": "value3",
|
|
65
102
|
}
|
|
66
|
-
|
|
67
|
-
label = "key1:key2"
|
|
68
|
-
partners = ["id::cell", "id::cell"]
|
|
69
|
-
txID = cell.create_tx(descr, key_values,
|
|
103
|
+
stx = "id::stx" # select Stream (STX)
|
|
104
|
+
label = "key1:key2" # label TX data
|
|
105
|
+
partners = ["id::cell", "id::cell"] # authorized Cells
|
|
106
|
+
txID = cell.create_tx(descr, key_values, stx, label, partners) # create TX
|
|
70
107
|
```
|
|
71
108
|
|
|
72
109
|
Activate Transmitter (TX):
|
|
73
110
|
```python
|
|
74
|
-
TX = "id::tx"
|
|
75
|
-
data = {
|
|
111
|
+
TX = "id::tx" # select Transmitter (TX)
|
|
112
|
+
data = { # enter key-values
|
|
76
113
|
"key1": "value1",
|
|
77
114
|
"key2": "value2",
|
|
78
115
|
"key3": "value3",
|
|
79
116
|
}
|
|
80
|
-
cell.activate_tx(TX, data)
|
|
117
|
+
cell.activate_tx(TX, data) # activate TX
|
|
81
118
|
```
|
|
82
119
|
|
|
83
120
|
Delete Transmitter (TX):
|
|
84
121
|
```python
|
|
85
|
-
TX = "id::tx"
|
|
86
|
-
cell.delete_tx(TX)
|
|
122
|
+
TX = "id::tx" # select Transmitter (TX)
|
|
123
|
+
cell.delete_tx(TX) # delete TX
|
|
87
124
|
```
|
|
88
125
|
|
|
89
|
-
List Transmitter (TX)
|
|
90
|
-
```python
|
|
91
|
-
|
|
92
|
-
txList = cell.list_tx(cellID) # list Transmitters (TX)
|
|
126
|
+
List Transmitter (TX) your Cell can activate:
|
|
127
|
+
```python
|
|
128
|
+
txList = cell.list_tx() # list Transmitters (TX)
|
|
93
129
|
```
|
|
94
130
|
|
|
95
131
|
### Circuits (CTX)
|
|
96
|
-
Circuits (CTX) store and organize data
|
|
132
|
+
Circuits (CTX) store and organize data using a Key-Value-Label system
|
|
97
133
|
|
|
98
134
|
Create Circuit (CTX):
|
|
99
135
|
```python
|
|
100
|
-
descr = "Test Circuit"
|
|
101
|
-
partners = ["id::cell", "id::cell"]
|
|
102
|
-
ctxID = cell.create_ctx(descr, partners)
|
|
136
|
+
descr = "Test Circuit" # description (max 25 characters)
|
|
137
|
+
partners = ["id::cell", "id::cell"] # authorized Cells
|
|
138
|
+
ctxID = cell.create_ctx(descr, partners) # create Circuit (CTX)
|
|
103
139
|
```
|
|
104
140
|
|
|
105
141
|
Store data on your private Circuit (CTX):
|
|
106
142
|
```python
|
|
107
|
-
label = "your_label"
|
|
108
|
-
data = {
|
|
143
|
+
label = "your_label" # data label (should be unique)
|
|
144
|
+
data = { # data as key-value pairs
|
|
109
145
|
"key1": "value1",
|
|
110
146
|
"key2": "value2",
|
|
111
147
|
"key3": "value3",
|
|
112
148
|
}
|
|
113
|
-
cell.store(label, data)
|
|
149
|
+
cell.store(label, data) # store data
|
|
114
150
|
```
|
|
115
151
|
|
|
116
152
|
Store data on a public Circuit (CTX):
|
|
117
153
|
```python
|
|
118
|
-
CTX = "id::ctx"
|
|
119
|
-
label = "your_label"
|
|
120
|
-
data = {
|
|
154
|
+
CTX = "id::ctx" # select Circuit (CTX
|
|
155
|
+
label = "your_label" # data label (should be unique)
|
|
156
|
+
data = { # data as key-value pairs
|
|
121
157
|
"key1": "value1",
|
|
122
158
|
"key2": "value2",
|
|
123
159
|
"key3": "value3",
|
|
124
160
|
}
|
|
125
|
-
cell.store(label, data, CTX)
|
|
161
|
+
cell.store(label, data, CTX) # store data
|
|
126
162
|
```
|
|
127
163
|
|
|
128
164
|
Load data from your private Circuit (CTX):
|
|
129
165
|
```python
|
|
130
|
-
label = "your_label"
|
|
131
|
-
data = cell.load(label)
|
|
132
|
-
key1 = data["key1"]
|
|
166
|
+
label = "your_label" # select label
|
|
167
|
+
data = cell.load(label) # load data by label
|
|
168
|
+
key1 = data["key1"] # get data from key
|
|
133
169
|
key2 = data["key2"]
|
|
134
170
|
key3 = data["key3"]
|
|
135
|
-
print(key1, key2, key3)
|
|
171
|
+
print(key1, key2, key3) # print data
|
|
136
172
|
```
|
|
137
173
|
|
|
138
174
|
Load data from a public Circuit (CTX):
|
|
139
175
|
```python
|
|
140
|
-
CTX = "id::ctx"
|
|
141
|
-
label = "your_label"
|
|
142
|
-
data = cell.load(label, CTX)
|
|
143
|
-
key1 = data["key1"]
|
|
176
|
+
CTX = "id::ctx" # select Circuit (CTX)
|
|
177
|
+
label = "your_label" # select label
|
|
178
|
+
data = cell.load(label, CTX) # load data by label
|
|
179
|
+
key1 = data["key1"] # get data from key
|
|
144
180
|
key2 = data["key2"]
|
|
145
181
|
key3 = data["key3"]
|
|
146
|
-
print(key1, key2, key3)
|
|
182
|
+
print(key1, key2, key3) # print data
|
|
147
183
|
```
|
|
148
184
|
|
|
149
185
|
Delete data from your private Circuit (CTX):
|
|
150
186
|
```python
|
|
151
|
-
label = "your_label"
|
|
152
|
-
cell.delete(label)
|
|
187
|
+
label = "your_label" # select label
|
|
188
|
+
cell.delete(label) # delete data by label
|
|
153
189
|
```
|
|
154
190
|
|
|
155
191
|
Delete data from a public Circuit (CTX):
|
|
156
192
|
```python
|
|
157
|
-
CTX = "id::ctx"
|
|
158
|
-
label = "your_label"
|
|
159
|
-
cell.delete(label, CTX)
|
|
193
|
+
CTX = "id::ctx" # select Circuits (CTX)
|
|
194
|
+
label = "your_label" # select label
|
|
195
|
+
cell.delete(label, CTX) # delete data by label
|
|
160
196
|
```
|
|
161
197
|
|
|
162
198
|
Clear your private Circuit (CTX):
|
|
163
199
|
```python
|
|
164
|
-
cell.clear()
|
|
200
|
+
cell.clear() # clear Circuit (CTX)
|
|
165
201
|
```
|
|
166
202
|
|
|
167
203
|
Clear Circuit (CTX):
|
|
168
204
|
```python
|
|
169
|
-
CTX = "id::ctx"
|
|
170
|
-
cell.clear(CTX)
|
|
205
|
+
CTX = "id::ctx" # select Circuit (CTX)
|
|
206
|
+
cell.clear(CTX) # clear CTX
|
|
171
207
|
```
|
|
172
208
|
|
|
173
209
|
Delete Circuit (CTX):
|
|
174
210
|
```python
|
|
175
|
-
CTX = "id::ctx"
|
|
176
|
-
cell.delete_ctx(CTX)
|
|
211
|
+
CTX = "id::ctx" # select Circuit (CTX)
|
|
212
|
+
cell.delete_ctx(CTX) # delete CTX
|
|
177
213
|
```
|
|
178
214
|
|
|
179
|
-
List Circuits (CTX)
|
|
180
|
-
```python
|
|
181
|
-
|
|
182
|
-
ctxList = cell.list_ctx(cellID) # list Circuits (CTX)
|
|
215
|
+
List Circuits (CTX) your Cell can interact with:
|
|
216
|
+
```python
|
|
217
|
+
ctxList = cell.list_ctx() # list Circuits (CTX)
|
|
183
218
|
```
|
|
184
219
|
|
|
185
220
|
### Streams (STX)
|
|
@@ -187,39 +222,39 @@ Streams (STX) facilitate real-time data synchronization and interaction, ensurin
|
|
|
187
222
|
|
|
188
223
|
Create Stream (STX):
|
|
189
224
|
```python
|
|
190
|
-
descr = "Test Stream"
|
|
191
|
-
partners = ["id::cell", "id::cell"]
|
|
192
|
-
stxID = cell.create_stx(descr, partners)
|
|
225
|
+
descr = "Test Stream" # description (max 25 characters)
|
|
226
|
+
partners = ["id::cell", "id::cell"] # authorized Cells
|
|
227
|
+
stxID = cell.create_stx(descr, partners) # create Stream (STX)
|
|
193
228
|
```
|
|
194
229
|
|
|
195
230
|
Stream data to your private Stream (STX):
|
|
196
231
|
```python
|
|
197
|
-
label = "your_label"
|
|
198
|
-
data = {
|
|
232
|
+
label = "your_label" # data label
|
|
233
|
+
data = { # data as key-value pairs
|
|
199
234
|
"key1": "value1",
|
|
200
235
|
"key2": "value2",
|
|
201
236
|
"key3": "value3",
|
|
202
237
|
}
|
|
203
|
-
cell.stream(label, data)
|
|
238
|
+
cell.stream(label, data) # stream data
|
|
204
239
|
```
|
|
205
240
|
|
|
206
241
|
Stream data to a public Stream (STX):
|
|
207
242
|
```python
|
|
208
|
-
STX = "id::stx"
|
|
209
|
-
label = "your_label"
|
|
210
|
-
data = {
|
|
243
|
+
STX = "id::stx" # select Stream (STX)
|
|
244
|
+
label = "your_label" # data label
|
|
245
|
+
data = { # data as key-value pairs
|
|
211
246
|
"key1": "value1",
|
|
212
247
|
"key2": "value2",
|
|
213
248
|
"key3": "value3",
|
|
214
249
|
}
|
|
215
|
-
cell.stream(label, data, STX)
|
|
250
|
+
cell.stream(label, data, STX) # stream data
|
|
216
251
|
```
|
|
217
252
|
|
|
218
253
|
Sync data from your private Stream (STX):
|
|
219
254
|
```python
|
|
220
|
-
stream = cell.sync()
|
|
221
|
-
for operation in stream:
|
|
222
|
-
label = operation.get("label")
|
|
255
|
+
stream = cell.sync() # synchronize Stream (STX)
|
|
256
|
+
for operation in stream: # load stream operations
|
|
257
|
+
label = operation.get("label") # get the operation details by key
|
|
223
258
|
key1 = operation.get("data").get("key1")
|
|
224
259
|
key2 = operation.get("data").get("key2")
|
|
225
260
|
key3 = operation.get("data").get("key3")
|
|
@@ -230,10 +265,10 @@ for operation in stream: # load s
|
|
|
230
265
|
|
|
231
266
|
Sync data from a public Stream (STX):
|
|
232
267
|
```python
|
|
233
|
-
STX = "id::stx"
|
|
234
|
-
stream = cell.sync(STX)
|
|
235
|
-
for operation in stream:
|
|
236
|
-
label = operation.get("label")
|
|
268
|
+
STX = "id::stx" # select Stream (STX)
|
|
269
|
+
stream = cell.sync(STX) # synchronize Stream (STX)
|
|
270
|
+
for operation in stream: # load stream operations
|
|
271
|
+
label = operation.get("label") # get the operation details by key
|
|
237
272
|
key1 = operation.get("data").get("key1")
|
|
238
273
|
key2 = operation.get("data").get("key2")
|
|
239
274
|
key3 = operation.get("data").get("key3")
|
|
@@ -242,25 +277,56 @@ for operation in stream: # load s
|
|
|
242
277
|
operator = operation.get("operator")
|
|
243
278
|
```
|
|
244
279
|
|
|
245
|
-
List Streams (STX)
|
|
246
|
-
```python
|
|
247
|
-
|
|
248
|
-
stxList = cell.list_stx(cellID) # list Streams (STX)
|
|
280
|
+
List Streams (STX) your Cell can interact with:
|
|
281
|
+
```python
|
|
282
|
+
stxList = cell.list_stx() # list Streams (STX)
|
|
249
283
|
```
|
|
250
284
|
|
|
251
|
-
###
|
|
252
|
-
|
|
285
|
+
### Contracts/Tokens
|
|
286
|
+
Contracts define rules for authorization, allowing users to sign and generate unique tokens for secure access
|
|
253
287
|
|
|
254
|
-
|
|
288
|
+
Create a Contract:
|
|
255
289
|
```python
|
|
256
|
-
descr = "
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
290
|
+
descr = "Test Contract" # short description (max 25 characters)
|
|
291
|
+
details = { # define token details
|
|
292
|
+
"price_in_eur": 10, # token price in EUR
|
|
293
|
+
"max_usage": 10, # max number of uses
|
|
294
|
+
"validity_in_min": 10 # token expiration time (minutes)
|
|
295
|
+
}
|
|
296
|
+
partners = ["id::cell", "id::cell"]
|
|
297
|
+
contractID = cell.create_contract(descr, details, partners)
|
|
260
298
|
```
|
|
261
299
|
|
|
262
|
-
|
|
263
|
-
```python
|
|
264
|
-
|
|
265
|
-
cell.
|
|
300
|
+
Sign a Contract:
|
|
301
|
+
```python
|
|
302
|
+
contractID = "id::contract" # select contract
|
|
303
|
+
token = cell.sign_contract(contractID)
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Request a Token from another Cell to authorize a service:
|
|
307
|
+
```python
|
|
308
|
+
cp = "id::cell" # select counterparty cell
|
|
309
|
+
contractID = "id::contract" # select contract
|
|
310
|
+
cell.request_token(cp, contractID)
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Present a Token to another Cell to authorize a service:
|
|
314
|
+
```python
|
|
315
|
+
token = "token" # select token
|
|
316
|
+
cp = "id::cell" # select counterparty cell
|
|
317
|
+
contractID = "id::contract" # select the contract
|
|
318
|
+
cell.present_token(token, cp, contractID)
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
Validate a Token to authorize a service:
|
|
322
|
+
```python
|
|
323
|
+
token = "token" # select token
|
|
324
|
+
cp = "id::cell" # select counterparty cell
|
|
325
|
+
contractID = "id::contract" # select contract
|
|
326
|
+
cell.validate_token(token, cp, contractID)
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
List Contracts your Cell can interact with:
|
|
330
|
+
```python
|
|
331
|
+
contractList = cell.list_contracts()
|
|
266
332
|
```
|