neuronum 1.5.1__tar.gz → 1.7.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.

@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neuronum
3
- Version: 1.5.1
4
- Summary: Interact with the Neuronum Network to build & automate interconnected networks of soft- and hardware components
3
+ Version: 1.7.0
4
+ Summary: Official client library to interact with the Neuronum Network
5
5
  Home-page: https://neuronum.net
6
6
  Author: Neuronum Cybernetics
7
7
  Author-email: welcome@neuronum.net
@@ -9,52 +9,98 @@ Project-URL: GitHub, https://github.com/neuronumcybernetics/neuronum
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.6
12
+ Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: requests
16
16
  Requires-Dist: websocket-client
17
+ Requires-Dist: click
18
+ Requires-Dist: questionary
19
+ Requires-Dist: python-dotenv
17
20
 
18
21
  ![Neuronum Logo](https://neuronum.net/static/logo_pip.png "Neuronum")
19
22
 
20
- [![Website](https://img.shields.io/badge/Website-Neuronum-blue)](https://neuronum.net)
21
- [![Documentation](https://img.shields.io/badge/Docs-Read%20now-green)](https://github.com/neuronumcybernetics/neuronum)
22
- [![Tutorials](https://img.shields.io/badge/Tutorials-Watch%20now-red)](https://www.youtube.com/@neuronumnet)
23
+ [![Website](https://img.shields.io/badge/Website-Neuronum-blue)](https://neuronum.net) [![Documentation](https://img.shields.io/badge/Docs-Read%20now-green)](https://github.com/neuronumcybernetics/neuronum)
23
24
 
24
- `Neuronum` is a cybernetic framework enabling businesses to build & automate interconnected networks of soft- and hardware components
25
+ Build, deploy and automate IoT connectivity with `Neuronum`
25
26
 
26
27
  ## Features
27
- - **Cell**: Identity to connect and interact with the Neuronum Network
28
+ - **Cells/Cell-CLI**: Create and manage Neuronum Cells from the command line
29
+ - **Nodes/Node-CLI**: Setup and manage Neuronum Nodes from the command line
28
30
  - **Transmitters (TX)**: Automate economic data transfer
29
31
  - **Circuits (CTX)**: Store data in Key-Value-Label databases
30
32
  - **Streams (STX)**: Stream, synchronize and control data in real time
31
- - **Nodes**: Soft-/Hardware components participating in the Network ecosystem
33
+ - **Contracts/Tokens**: Automate services exchange and authorization between Cells and Nodes
32
34
 
33
- To interact with the Network you will need to create a Neuronum Cell.
34
- Create your Cell: [Create Cell](https://neuronum.net/createcell)
35
+ ### Installation
36
+ Install the Neuronum library using pip:
37
+ ```sh
38
+ $ pip install neuronum
39
+ ```
35
40
 
41
+ ### Cells/Cell-CLI
42
+ To interact with the Neuronum Network, you must first create a Neuronum Cell
36
43
 
37
- ### Installation & Connection
38
- Start with installing the Neuronum library using pip:
39
- ```python
40
- pip install neuronum
44
+ Create Cell:
45
+ ```sh
46
+ $ neuronum create-cell
41
47
  ```
42
48
 
43
- Configure and test Cell connection:
44
- ```python
45
- import neuronum
49
+ Connect Cell:
50
+ ```sh
51
+ $ neuronum connect-cell
52
+ ```
53
+
54
+ View connected Cell:
55
+ ```sh
56
+ $ neuronum view-cell
57
+ ```
58
+
59
+ Disconnect Cell:
60
+ ```sh
61
+ $ neuronum disconnect-cell
62
+ ```
63
+
64
+ Delete Cell:
65
+ ```sh
66
+ $ neuronum delete-cell
67
+ ```
68
+
69
+ ### Nodes/Node-CLI
70
+ Neuronum Nodes are soft- and hardware components that power the Neuronum Network, enabling seamless communication between Nodes and Cells
71
+
72
+ Initialize a Node:
73
+ ```sh
74
+ $ neuronum init-node # neuronum init-node --sync id::stx (optional)
75
+ ```
76
+
77
+ Start a Node:
78
+ ```sh
79
+ $ neuronum start-node
80
+ ```
81
+
82
+ Stop a Node:
83
+ ```sh
84
+ $ neuronum stop-node
85
+ ```
46
86
 
47
- cell = neuronum.Cell(
48
- host="host::cell", # cell host
49
- password="your_password", # cell password
50
- network="neuronum.net", # cell network
51
- synapse="your_synapse" # cell synapse
52
- )
53
- cell.connect() # connect to network
87
+ Register a Node on the Neuronum Network:
88
+ ```sh
89
+ $ neuronum register-node
90
+ ```
91
+
92
+ Update a Node:
93
+ ```sh
94
+ $ neuronum update-node
95
+ ```
96
+
97
+ Delete a Node:
98
+ ```sh
99
+ $ neuronum delete-node
54
100
  ```
55
101
 
56
102
  ### Transmitters (TX)
57
- Transmitters (TX) are used to create predefined templates to receive and send data in a standardized format.
103
+ Transmitters (TX) are used to create predefined templates to receive and send data in a standardized format
58
104
 
59
105
  Create Transmitter (TX):
60
106
  ```python
@@ -87,10 +133,9 @@ TX = "id::tx" # select Trans
87
133
  cell.delete_tx(TX) # delete TX
88
134
  ```
89
135
 
90
- List Transmitter (TX) from Cell:
91
- ```python
92
- cellID = "id::cell" # select Cell
93
- txList = cell.list_tx(cellID) # list Transmitters (TX)
136
+ List Transmitter (TX) your Cell can activate:
137
+ ```python
138
+ txList = cell.list_tx() # list Transmitters (TX)
94
139
  ```
95
140
 
96
141
  ### Circuits (CTX)
@@ -177,10 +222,9 @@ CTX = "id::ctx" # select Circu
177
222
  cell.delete_ctx(CTX) # delete CTX
178
223
  ```
179
224
 
180
- List Circuits (CTX) from Cell:
181
- ```python
182
- cellID = "id::cell" # select Cell
183
- ctxList = cell.list_ctx(cellID) # list Circuits (CTX)
225
+ List Circuits (CTX) your Cell can interact with:
226
+ ```python
227
+ ctxList = cell.list_ctx() # list Circuits (CTX)
184
228
  ```
185
229
 
186
230
  ### Streams (STX)
@@ -243,25 +287,56 @@ for operation in stream: # load stream
243
287
  operator = operation.get("operator")
244
288
  ```
245
289
 
246
- List Streams (STX) from Cell:
247
- ```python
248
- cellID = "id::cell" # select Cell
249
- stxList = cell.list_stx(cellID) # list Streams (STX)
290
+ List Streams (STX) your Cell can interact with:
291
+ ```python
292
+ stxList = cell.list_stx() # list Streams (STX)
250
293
  ```
251
294
 
252
- ### Nodes
253
- Neuronum Nodes are computing hardware running the Neuronum Client Library, enabling seamless data transmission, synchronization, and facilitating public Stream (STX) access
295
+ ### Contracts/Tokens
296
+ Contracts are predefined token-based rules to automate service exchange and authorization between Cells and Nodes
254
297
 
255
- Register a Node with its associated Stream (STX):
298
+ Create a Contract:
256
299
  ```python
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
300
+ descr = "Test Contract" # short description (max 25 characters)
301
+ details = { # define token details
302
+ "price_in_eur": False, # token price in EUR (int, float or False)
303
+ "max_usage": False, # max number of uses (int or False)
304
+ "validity_in_min": False # token expiration time in min (int, float or False)
305
+ }
306
+ partners = ["id::cell", "id::cell"]
307
+ contractID = cell.create_contract(descr, details, partners)
261
308
  ```
262
309
 
263
- Delete Node:
264
- ```python
265
- nodeID = "id::node" # select Node
266
- cell.delete_node(nodeID) # delete Node
310
+ Sign a Contract:
311
+ ```python
312
+ contractID = "id::contract" # select contract
313
+ token = cell.sign_contract(contractID)
314
+ ```
315
+
316
+ Request a Token from another Cell to authorize a service:
317
+ ```python
318
+ cp = "id::cell" # select counterparty cell
319
+ contractID = "id::contract" # select contract
320
+ cell.request_token(cp, contractID)
321
+ ```
322
+
323
+ Present a Token to another Cell to authorize a service:
324
+ ```python
325
+ token = "token" # select token
326
+ cp = "id::cell" # select counterparty cell
327
+ contractID = "id::contract" # select the contract
328
+ cell.present_token(token, cp, contractID)
329
+ ```
330
+
331
+ Validate a Token to authorize a service:
332
+ ```python
333
+ token = "token" # select token
334
+ cp = "id::cell" # select counterparty cell
335
+ contractID = "id::contract" # select contract
336
+ cell.validate_token(token, cp, contractID)
337
+ ```
338
+
339
+ List Contracts your Cell can interact with:
340
+ ```python
341
+ contractList = cell.list_contracts()
267
342
  ```
@@ -1,43 +1,86 @@
1
1
  ![Neuronum Logo](https://neuronum.net/static/logo_pip.png "Neuronum")
2
2
 
3
- [![Website](https://img.shields.io/badge/Website-Neuronum-blue)](https://neuronum.net)
4
- [![Documentation](https://img.shields.io/badge/Docs-Read%20now-green)](https://github.com/neuronumcybernetics/neuronum)
5
- [![Tutorials](https://img.shields.io/badge/Tutorials-Watch%20now-red)](https://www.youtube.com/@neuronumnet)
3
+ [![Website](https://img.shields.io/badge/Website-Neuronum-blue)](https://neuronum.net) [![Documentation](https://img.shields.io/badge/Docs-Read%20now-green)](https://github.com/neuronumcybernetics/neuronum)
6
4
 
7
- `Neuronum` is a cybernetic framework enabling businesses to build & automate interconnected networks of soft- and hardware components
5
+ Build, deploy and automate IoT connectivity with `Neuronum`
8
6
 
9
7
  ## Features
10
- - **Cell**: Identity to connect and interact with the Neuronum Network
8
+ - **Cells/Cell-CLI**: Create and manage Neuronum Cells from the command line
9
+ - **Nodes/Node-CLI**: Setup and manage Neuronum Nodes from the command line
11
10
  - **Transmitters (TX)**: Automate economic data transfer
12
11
  - **Circuits (CTX)**: Store data in Key-Value-Label databases
13
12
  - **Streams (STX)**: Stream, synchronize and control data in real time
14
- - **Nodes**: Soft-/Hardware components participating in the Network ecosystem
13
+ - **Contracts/Tokens**: Automate services exchange and authorization between Cells and Nodes
15
14
 
16
- To interact with the Network you will need to create a Neuronum Cell.
17
- Create your Cell: [Create Cell](https://neuronum.net/createcell)
15
+ ### Installation
16
+ Install the Neuronum library using pip:
17
+ ```sh
18
+ $ pip install neuronum
19
+ ```
18
20
 
21
+ ### Cells/Cell-CLI
22
+ To interact with the Neuronum Network, you must first create a Neuronum Cell
19
23
 
20
- ### Installation & Connection
21
- Start with installing the Neuronum library using pip:
22
- ```python
23
- pip install neuronum
24
+ Create Cell:
25
+ ```sh
26
+ $ neuronum create-cell
24
27
  ```
25
28
 
26
- Configure and test Cell connection:
27
- ```python
28
- import neuronum
29
+ Connect Cell:
30
+ ```sh
31
+ $ neuronum connect-cell
32
+ ```
33
+
34
+ View connected Cell:
35
+ ```sh
36
+ $ neuronum view-cell
37
+ ```
38
+
39
+ Disconnect Cell:
40
+ ```sh
41
+ $ neuronum disconnect-cell
42
+ ```
43
+
44
+ Delete Cell:
45
+ ```sh
46
+ $ neuronum delete-cell
47
+ ```
48
+
49
+ ### Nodes/Node-CLI
50
+ Neuronum Nodes are soft- and hardware components that power the Neuronum Network, enabling seamless communication between Nodes and Cells
51
+
52
+ Initialize a Node:
53
+ ```sh
54
+ $ neuronum init-node # neuronum init-node --sync id::stx (optional)
55
+ ```
56
+
57
+ Start a Node:
58
+ ```sh
59
+ $ neuronum start-node
60
+ ```
61
+
62
+ Stop a Node:
63
+ ```sh
64
+ $ neuronum stop-node
65
+ ```
29
66
 
30
- cell = neuronum.Cell(
31
- host="host::cell", # cell host
32
- password="your_password", # cell password
33
- network="neuronum.net", # cell network
34
- synapse="your_synapse" # cell synapse
35
- )
36
- cell.connect() # connect to network
67
+ Register a Node on the Neuronum Network:
68
+ ```sh
69
+ $ neuronum register-node
70
+ ```
71
+
72
+ Update a Node:
73
+ ```sh
74
+ $ neuronum update-node
75
+ ```
76
+
77
+ Delete a Node:
78
+ ```sh
79
+ $ neuronum delete-node
37
80
  ```
38
81
 
39
82
  ### Transmitters (TX)
40
- Transmitters (TX) are used to create predefined templates to receive and send data in a standardized format.
83
+ Transmitters (TX) are used to create predefined templates to receive and send data in a standardized format
41
84
 
42
85
  Create Transmitter (TX):
43
86
  ```python
@@ -70,10 +113,9 @@ TX = "id::tx" # select Trans
70
113
  cell.delete_tx(TX) # delete TX
71
114
  ```
72
115
 
73
- List Transmitter (TX) from Cell:
74
- ```python
75
- cellID = "id::cell" # select Cell
76
- txList = cell.list_tx(cellID) # list Transmitters (TX)
116
+ List Transmitter (TX) your Cell can activate:
117
+ ```python
118
+ txList = cell.list_tx() # list Transmitters (TX)
77
119
  ```
78
120
 
79
121
  ### Circuits (CTX)
@@ -160,10 +202,9 @@ CTX = "id::ctx" # select Circu
160
202
  cell.delete_ctx(CTX) # delete CTX
161
203
  ```
162
204
 
163
- List Circuits (CTX) from Cell:
164
- ```python
165
- cellID = "id::cell" # select Cell
166
- ctxList = cell.list_ctx(cellID) # list Circuits (CTX)
205
+ List Circuits (CTX) your Cell can interact with:
206
+ ```python
207
+ ctxList = cell.list_ctx() # list Circuits (CTX)
167
208
  ```
168
209
 
169
210
  ### Streams (STX)
@@ -226,25 +267,56 @@ for operation in stream: # load stream
226
267
  operator = operation.get("operator")
227
268
  ```
228
269
 
229
- List Streams (STX) from Cell:
230
- ```python
231
- cellID = "id::cell" # select Cell
232
- stxList = cell.list_stx(cellID) # list Streams (STX)
270
+ List Streams (STX) your Cell can interact with:
271
+ ```python
272
+ stxList = cell.list_stx() # list Streams (STX)
233
273
  ```
234
274
 
235
- ### Nodes
236
- Neuronum Nodes are computing hardware running the Neuronum Client Library, enabling seamless data transmission, synchronization, and facilitating public Stream (STX) access
275
+ ### Contracts/Tokens
276
+ Contracts are predefined token-based rules to automate service exchange and authorization between Cells and Nodes
237
277
 
238
- Register a Node with its associated Stream (STX):
278
+ Create a Contract:
239
279
  ```python
240
- descr = "node_name" # description (max 25 characters)
241
- mode = "public" # "public" or "private" Node
242
- STX = "id::stx" # select Stream (STX)
243
- nodeID = cell.register_node(descr, mode, STX) # register Node
280
+ descr = "Test Contract" # short description (max 25 characters)
281
+ details = { # define token details
282
+ "price_in_eur": False, # token price in EUR (int, float or False)
283
+ "max_usage": False, # max number of uses (int or False)
284
+ "validity_in_min": False # token expiration time in min (int, float or False)
285
+ }
286
+ partners = ["id::cell", "id::cell"]
287
+ contractID = cell.create_contract(descr, details, partners)
244
288
  ```
245
289
 
246
- Delete Node:
247
- ```python
248
- nodeID = "id::node" # select Node
249
- cell.delete_node(nodeID) # delete Node
290
+ Sign a Contract:
291
+ ```python
292
+ contractID = "id::contract" # select contract
293
+ token = cell.sign_contract(contractID)
294
+ ```
295
+
296
+ Request a Token from another Cell to authorize a service:
297
+ ```python
298
+ cp = "id::cell" # select counterparty cell
299
+ contractID = "id::contract" # select contract
300
+ cell.request_token(cp, contractID)
301
+ ```
302
+
303
+ Present a Token to another Cell to authorize a service:
304
+ ```python
305
+ token = "token" # select token
306
+ cp = "id::cell" # select counterparty cell
307
+ contractID = "id::contract" # select the contract
308
+ cell.present_token(token, cp, contractID)
309
+ ```
310
+
311
+ Validate a Token to authorize a service:
312
+ ```python
313
+ token = "token" # select token
314
+ cp = "id::cell" # select counterparty cell
315
+ contractID = "id::contract" # select contract
316
+ cell.validate_token(token, cp, contractID)
250
317
  ```
318
+
319
+ List Contracts your Cell can interact with:
320
+ ```python
321
+ contractList = cell.list_contracts()
322
+ ```
File without changes