neuronum 5.0.1__py3-none-any.whl → 5.1.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 +82 -13
- {neuronum-5.0.1.dist-info → neuronum-5.1.1.dist-info}/METADATA +18 -7
- neuronum-5.1.1.dist-info/RECORD +10 -0
- neuronum-5.0.1.dist-info/RECORD +0 -10
- {neuronum-5.0.1.dist-info → neuronum-5.1.1.dist-info}/WHEEL +0 -0
- {neuronum-5.0.1.dist-info → neuronum-5.1.1.dist-info}/entry_points.txt +0 -0
- {neuronum-5.0.1.dist-info → neuronum-5.1.1.dist-info}/licenses/LICENSE +0 -0
- {neuronum-5.0.1.dist-info → neuronum-5.1.1.dist-info}/top_level.txt +0 -0
cli/main.py
CHANGED
|
@@ -249,10 +249,11 @@ def delete_cell():
|
|
|
249
249
|
@click.command()
|
|
250
250
|
@click.option('--sync', multiple=True, default=None, help="Optional stream IDs for sync.")
|
|
251
251
|
@click.option('--stream', multiple=True, default=None, help="Optional stream ID for stream.")
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
@click.option('--app', is_flag=True, help="Generate a Node with app template")
|
|
253
|
+
def init_node(sync, stream, app):
|
|
254
|
+
asyncio.run(async_init_node(sync, stream, app))
|
|
254
255
|
|
|
255
|
-
async def async_init_node(sync, stream):
|
|
256
|
+
async def async_init_node(sync, stream, app):
|
|
256
257
|
credentials_folder_path = Path.home() / ".neuronum"
|
|
257
258
|
env_path = credentials_folder_path / ".env"
|
|
258
259
|
|
|
@@ -319,13 +320,35 @@ async def async_init_node(sync, stream):
|
|
|
319
320
|
await asyncio.to_thread(gitignore_path.write_text, ".env\n")
|
|
320
321
|
|
|
321
322
|
nodemd_path = project_path / "NODE.md"
|
|
322
|
-
await asyncio.to_thread(nodemd_path.write_text, """###
|
|
323
|
-
### Use this .md file to add instructions on how to interact with your Node
|
|
323
|
+
await asyncio.to_thread(nodemd_path.write_text, """### NODE.md: How to interact with this Node
|
|
324
324
|
|
|
325
325
|
```json
|
|
326
326
|
{
|
|
327
|
-
"
|
|
328
|
-
|
|
327
|
+
"info": {
|
|
328
|
+
"use_case": "This Node...",
|
|
329
|
+
"github": "https://github.com/user"
|
|
330
|
+
},
|
|
331
|
+
"gateways": [
|
|
332
|
+
{
|
|
333
|
+
"type": "stream",
|
|
334
|
+
"id": "id::stx",
|
|
335
|
+
"link": "https://neuronum.net/stream/id::stx"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"type": "transmitter",
|
|
339
|
+
"id": "id::tx",
|
|
340
|
+
"link": "https://neuronum.net/tx/id::tx",
|
|
341
|
+
}
|
|
342
|
+
{
|
|
343
|
+
"type": "circuit",
|
|
344
|
+
"id": "id::ctx",
|
|
345
|
+
"link": "https://neuronum.net/circuit/id::ctx",
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"initialization": {
|
|
349
|
+
"command": "neuronum init-node --sync id::stx"
|
|
350
|
+
},
|
|
351
|
+
"requirements": [
|
|
329
352
|
{
|
|
330
353
|
"name": "Python",
|
|
331
354
|
"version": ">= 3.8",
|
|
@@ -333,12 +356,10 @@ async def async_init_node(sync, stream):
|
|
|
333
356
|
},
|
|
334
357
|
{
|
|
335
358
|
"name": "neuronum",
|
|
336
|
-
"version": ">=
|
|
359
|
+
"version": ">= 5.1.0",
|
|
337
360
|
"link": "https://pypi.org/project/neuronum/"
|
|
338
361
|
}
|
|
339
|
-
]
|
|
340
|
-
"Installation": "pip install neuronum",
|
|
341
|
-
"Initialization": "neuronum init-node"
|
|
362
|
+
]
|
|
342
363
|
}
|
|
343
364
|
```"""
|
|
344
365
|
)
|
|
@@ -418,7 +439,7 @@ async def main():
|
|
|
418
439
|
asyncio.run(main())
|
|
419
440
|
""")
|
|
420
441
|
|
|
421
|
-
if not sync and not stream:
|
|
442
|
+
if not sync and not stream and not app:
|
|
422
443
|
sync_path = project_path / f"sync_{stx.replace('::stx', '')}.py"
|
|
423
444
|
sync_path.write_text(f"""\
|
|
424
445
|
import asyncio
|
|
@@ -476,6 +497,54 @@ async def main():
|
|
|
476
497
|
}}
|
|
477
498
|
await cell.stream(label, data)
|
|
478
499
|
|
|
500
|
+
asyncio.run(main())
|
|
501
|
+
""")
|
|
502
|
+
|
|
503
|
+
if app:
|
|
504
|
+
app_path = project_path / "app.py"
|
|
505
|
+
app_path.write_text(f"""\
|
|
506
|
+
import asyncio
|
|
507
|
+
import neuronum
|
|
508
|
+
import os
|
|
509
|
+
from dotenv import load_dotenv
|
|
510
|
+
|
|
511
|
+
load_dotenv()
|
|
512
|
+
host = os.getenv("HOST")
|
|
513
|
+
password = os.getenv("PASSWORD")
|
|
514
|
+
network = os.getenv("NETWORK")
|
|
515
|
+
synapse = os.getenv("SYNAPSE")
|
|
516
|
+
|
|
517
|
+
cell = neuronum.Cell(
|
|
518
|
+
host=host,
|
|
519
|
+
password=password,
|
|
520
|
+
network=network,
|
|
521
|
+
synapse=synapse
|
|
522
|
+
)
|
|
523
|
+
|
|
524
|
+
async def main():
|
|
525
|
+
STX = "id::stx"
|
|
526
|
+
async for operation in cell.sync(STX):
|
|
527
|
+
txID = operation.get("txID")
|
|
528
|
+
client = operation.get("operator")
|
|
529
|
+
|
|
530
|
+
if txID == "id::tx":
|
|
531
|
+
data = {{
|
|
532
|
+
"response": "TX activated!"
|
|
533
|
+
}}
|
|
534
|
+
await cell.tx_response(txID, client, data)
|
|
535
|
+
|
|
536
|
+
if txID == "id::tx":
|
|
537
|
+
data = {{
|
|
538
|
+
"response": "TX activated!"
|
|
539
|
+
}}
|
|
540
|
+
await cell.tx_response(txID, client, data)
|
|
541
|
+
|
|
542
|
+
if txID == "id::tx":
|
|
543
|
+
data = {{
|
|
544
|
+
"response": "TX activated!"
|
|
545
|
+
}}
|
|
546
|
+
await cell.tx_response(txID, client, data)
|
|
547
|
+
|
|
479
548
|
asyncio.run(main())
|
|
480
549
|
""")
|
|
481
550
|
|
|
@@ -488,7 +557,7 @@ def start_node(d):
|
|
|
488
557
|
click.echo("Starting Node...")
|
|
489
558
|
|
|
490
559
|
project_path = Path.cwd()
|
|
491
|
-
script_files = glob.glob("sync_*.py") + glob.glob("stream_*.py")
|
|
560
|
+
script_files = glob.glob("sync_*.py") + glob.glob("stream_*.py") + glob.glob("app.py")
|
|
492
561
|
|
|
493
562
|
processes = []
|
|
494
563
|
system_name = platform.system()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: neuronum
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.1.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
|
|
@@ -35,23 +35,23 @@ Dynamic: summary
|
|
|
35
35
|
[](https://neuronum.net) [](https://github.com/neuronumcybernetics/neuronum)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
## **Getting Started Goals**
|
|
39
39
|
- Learn about Neuronum
|
|
40
40
|
- Connect to Neuronum
|
|
41
41
|
- Build on Neuronum
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
### **About Neuronum**
|
|
45
|
-
Neuronum is a framework to build serverless data gateways automating the processing and distribution of data transmission, storage, and streaming.
|
|
45
|
+
Neuronum is a framework to build serverless connected app & data gateways automating the processing and distribution of data transmission, storage, and streaming.
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
### **
|
|
48
|
+
### **Features**
|
|
49
49
|
**Cell & Nodes**
|
|
50
50
|
- Cell: Account to connect and interact with Neuronum
|
|
51
|
-
- Nodes: Soft- and Hardware components hosting
|
|
51
|
+
- Nodes: Soft- and Hardware components hosting gateways
|
|
52
52
|
|
|
53
|
-
**
|
|
54
|
-
- Transmitters (TX):
|
|
53
|
+
**Gateways**
|
|
54
|
+
- Transmitters (TX): Securely transmit and receive data packages
|
|
55
55
|
- Circuits (CTX): Store data in cloud-based key-value-label databases
|
|
56
56
|
- Streams (STX): Stream, synchronize, and control data in real time
|
|
57
57
|
|
|
@@ -75,6 +75,12 @@ Create Cell:
|
|
|
75
75
|
neuronum create-cell # create Cell / Cell type / Cell network
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
or
|
|
79
|
+
|
|
80
|
+
Connect Cell:
|
|
81
|
+
```sh
|
|
82
|
+
neuronum connect-cell # connect Cell
|
|
83
|
+
```
|
|
78
84
|
|
|
79
85
|
View connected Cell:
|
|
80
86
|
```sh
|
|
@@ -103,3 +109,8 @@ Stop Node:
|
|
|
103
109
|
```sh
|
|
104
110
|
neuronum stop-node # stop Node
|
|
105
111
|
```
|
|
112
|
+
|
|
113
|
+
Connect Node to Neuronum:
|
|
114
|
+
```sh
|
|
115
|
+
neuronum connect-node # connect Node
|
|
116
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
cli/main.py,sha256=D-QZ7__wBMzuB2O1H-hsw_05UB_umWg_eUESkM4cTg0,26768
|
|
3
|
+
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
4
|
+
neuronum/neuronum.py,sha256=qzxc9csSEnGX8wRC_14vzjJPQsCTC8wswhXno1Ih_Xw,17166
|
|
5
|
+
neuronum-5.1.1.dist-info/licenses/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
6
|
+
neuronum-5.1.1.dist-info/METADATA,sha256=YayitV3237xAWylvf8ppCHoWublzqwO66aISPucTwFs,3060
|
|
7
|
+
neuronum-5.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
neuronum-5.1.1.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
|
|
9
|
+
neuronum-5.1.1.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
|
|
10
|
+
neuronum-5.1.1.dist-info/RECORD,,
|
neuronum-5.0.1.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
cli/main.py,sha256=g7Y-W1G7C1firXHsEnBFyqa52nSk6GVzcax_6up0Ezg,24991
|
|
3
|
-
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
4
|
-
neuronum/neuronum.py,sha256=qzxc9csSEnGX8wRC_14vzjJPQsCTC8wswhXno1Ih_Xw,17166
|
|
5
|
-
neuronum-5.0.1.dist-info/licenses/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
|
|
6
|
-
neuronum-5.0.1.dist-info/METADATA,sha256=pxMNkUpve0FgezRiZLDm3c-mboVYt3TGmGY8Cnut1ns,2883
|
|
7
|
-
neuronum-5.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
neuronum-5.0.1.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
|
|
9
|
-
neuronum-5.0.1.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
|
|
10
|
-
neuronum-5.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|