neuronum 1.7.0__py3-none-any.whl → 1.7.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.
- cli/main.py +7 -0
- neuronum/neuronum.py +21 -4
- {neuronum-1.7.0.dist-info → neuronum-1.7.1.dist-info}/METADATA +7 -2
- neuronum-1.7.1.dist-info/RECORD +10 -0
- neuronum-1.7.0.dist-info/RECORD +0 -10
- {neuronum-1.7.0.dist-info → neuronum-1.7.1.dist-info}/LICENSE +0 -0
- {neuronum-1.7.0.dist-info → neuronum-1.7.1.dist-info}/WHEEL +0 -0
- {neuronum-1.7.0.dist-info → neuronum-1.7.1.dist-info}/entry_points.txt +0 -0
- {neuronum-1.7.0.dist-info → neuronum-1.7.1.dist-info}/top_level.txt +0 -0
cli/main.py
CHANGED
|
@@ -289,6 +289,7 @@ def init_node(sync):
|
|
|
289
289
|
ctx = cell.list_ctx()
|
|
290
290
|
stx = cell.list_stx()
|
|
291
291
|
contracts = cell.list_contracts()
|
|
292
|
+
nodes = cell.list_nodes()
|
|
292
293
|
|
|
293
294
|
url = f"https://{network}/api/init_node/{node_type}"
|
|
294
295
|
|
|
@@ -324,6 +325,9 @@ def init_node(sync):
|
|
|
324
325
|
contracts_path = project_path / "contracts.json"
|
|
325
326
|
contracts_path.write_text(json.dumps(contracts, indent=4))
|
|
326
327
|
|
|
328
|
+
nodes_path = project_path / "nodes.json"
|
|
329
|
+
nodes_path.write_text(json.dumps(nodes, indent=4))
|
|
330
|
+
|
|
327
331
|
nodemd_path = project_path / "NODE.md"
|
|
328
332
|
nodemd_path.write_text("""\
|
|
329
333
|
## Use this NODE.md file to add instructions on how to interact with your node
|
|
@@ -516,16 +520,19 @@ def update_node():
|
|
|
516
520
|
ctx = cell.list_ctx()
|
|
517
521
|
stx = cell.list_stx()
|
|
518
522
|
contracts = cell.list_contracts()
|
|
523
|
+
nodes = cell.list_nodes()
|
|
519
524
|
|
|
520
525
|
tx_path = Path("transmitters.json")
|
|
521
526
|
ctx_path = Path("circuits.json")
|
|
522
527
|
stx_path = Path("streams.json")
|
|
523
528
|
contracts_path = Path("contracts.json")
|
|
529
|
+
nodes_path = Path("nodes.json")
|
|
524
530
|
|
|
525
531
|
tx_path.write_text(json.dumps(tx, indent=4))
|
|
526
532
|
ctx_path.write_text(json.dumps(ctx, indent=4))
|
|
527
533
|
stx_path.write_text(json.dumps(stx, indent=4))
|
|
528
534
|
contracts_path.write_text(json.dumps(contracts, indent=4))
|
|
535
|
+
nodes_path.write_text(json.dumps(nodes, indent=4))
|
|
529
536
|
|
|
530
537
|
click.echo(f"Neuronum Node '{nodeID}' updated! Visit: {node_url}")
|
|
531
538
|
|
neuronum/neuronum.py
CHANGED
|
@@ -214,7 +214,7 @@ class Cell:
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
try:
|
|
217
|
-
response = requests.
|
|
217
|
+
response = requests.get(full_url, json=list_tx)
|
|
218
218
|
response.raise_for_status()
|
|
219
219
|
return response.json()["Transmitters"]
|
|
220
220
|
except requests.exceptions.RequestException as e:
|
|
@@ -231,7 +231,7 @@ class Cell:
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
try:
|
|
234
|
-
response = requests.
|
|
234
|
+
response = requests.get(full_url, json=list_ctx)
|
|
235
235
|
response.raise_for_status()
|
|
236
236
|
return response.json()["Circuits"]
|
|
237
237
|
except requests.exceptions.RequestException as e:
|
|
@@ -248,7 +248,7 @@ class Cell:
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
try:
|
|
251
|
-
response = requests.
|
|
251
|
+
response = requests.get(full_url, json=list_stx)
|
|
252
252
|
response.raise_for_status()
|
|
253
253
|
return response.json()["Streams"]
|
|
254
254
|
except requests.exceptions.RequestException as e:
|
|
@@ -256,6 +256,23 @@ class Cell:
|
|
|
256
256
|
except Exception as e:
|
|
257
257
|
print(f"Unexpected error: {e}")
|
|
258
258
|
|
|
259
|
+
|
|
260
|
+
def list_nodes(self):
|
|
261
|
+
full_url = f"https://{self.network}/api/list_nodes"
|
|
262
|
+
|
|
263
|
+
list_nodes = {
|
|
264
|
+
"cell": self.to_dict()
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
try:
|
|
268
|
+
response = requests.get(full_url, json=list_nodes)
|
|
269
|
+
response.raise_for_status()
|
|
270
|
+
return response.json()["Nodes"]
|
|
271
|
+
except requests.exceptions.RequestException as e:
|
|
272
|
+
print(f"Error sending request: {e}")
|
|
273
|
+
except Exception as e:
|
|
274
|
+
print(f"Unexpected error: {e}")
|
|
275
|
+
|
|
259
276
|
|
|
260
277
|
def store(self, label: str, data: dict, ctx: Optional[str] = None):
|
|
261
278
|
if ctx:
|
|
@@ -533,7 +550,7 @@ class Cell:
|
|
|
533
550
|
}
|
|
534
551
|
|
|
535
552
|
try:
|
|
536
|
-
response = requests.
|
|
553
|
+
response = requests.get(full_url, json=list_contracts)
|
|
537
554
|
response.raise_for_status()
|
|
538
555
|
return response.json()["Contracts"]
|
|
539
556
|
except requests.exceptions.RequestException as e:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: neuronum
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.1
|
|
4
4
|
Summary: Official client library to interact with the Neuronum Network
|
|
5
5
|
Home-page: https://neuronum.net
|
|
6
6
|
Author: Neuronum Cybernetics
|
|
@@ -22,7 +22,7 @@ Requires-Dist: python-dotenv
|
|
|
22
22
|
|
|
23
23
|
[](https://neuronum.net) [](https://github.com/neuronumcybernetics/neuronum)
|
|
24
24
|
|
|
25
|
-
Build, deploy and automate IoT connectivity with `Neuronum`
|
|
25
|
+
Build, deploy and automate serverless IoT connectivity with `Neuronum`
|
|
26
26
|
|
|
27
27
|
## Features
|
|
28
28
|
- **Cells/Cell-CLI**: Create and manage Neuronum Cells from the command line
|
|
@@ -99,6 +99,11 @@ Delete a Node:
|
|
|
99
99
|
$ neuronum delete-node
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
List Nodes your Cell can interact with:
|
|
103
|
+
```python
|
|
104
|
+
nodesList = cell.list_nodes() # list Nodes
|
|
105
|
+
```
|
|
106
|
+
|
|
102
107
|
### Transmitters (TX)
|
|
103
108
|
Transmitters (TX) are used to create predefined templates to receive and send data in a standardized format
|
|
104
109
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
cli/main.py,sha256=hjo8-q9M_DUm7_Xe2ynb6L6wIMq2jfWnlp1oH5tBQD4,17896
|
|
3
|
+
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
4
|
+
neuronum/neuronum.py,sha256=91lOreL7TeD8VWdDCtS2xu7MO34taI4HEYr-Lpv6L9Y,17019
|
|
5
|
+
neuronum-1.7.1.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
6
|
+
neuronum-1.7.1.dist-info/METADATA,sha256=nDYzJ4gJGP9ZGX_3S0EEVyE0j7e64td3HH9wUkOrsTw,13000
|
|
7
|
+
neuronum-1.7.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
8
|
+
neuronum-1.7.1.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
|
|
9
|
+
neuronum-1.7.1.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
|
|
10
|
+
neuronum-1.7.1.dist-info/RECORD,,
|
neuronum-1.7.0.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
cli/main.py,sha256=w4pNMA7ySCKTk4Z-Mb3W7cIw5ZUpLrP92L2HfrcFxSM,17637
|
|
3
|
-
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
4
|
-
neuronum/neuronum.py,sha256=4j3fV7VHPb1KcQucOEDBQ-v2SoG9c2WfGPqMfI3OF88,16498
|
|
5
|
-
neuronum-1.7.0.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
6
|
-
neuronum-1.7.0.dist-info/METADATA,sha256=GqgpO0lCzLKJwOfNRH8GzXPbRgsvRvZm3YP5FPVMbNs,12806
|
|
7
|
-
neuronum-1.7.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
8
|
-
neuronum-1.7.0.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
|
|
9
|
-
neuronum-1.7.0.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
|
|
10
|
-
neuronum-1.7.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|