neuronum 5.5.0__py3-none-any.whl → 5.7.0__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 +88 -2
- {neuronum-5.5.0.dist-info → neuronum-5.7.0.dist-info}/METADATA +17 -10
- neuronum-5.7.0.dist-info/RECORD +10 -0
- neuronum-5.5.0.dist-info/RECORD +0 -10
- {neuronum-5.5.0.dist-info → neuronum-5.7.0.dist-info}/WHEEL +0 -0
- {neuronum-5.5.0.dist-info → neuronum-5.7.0.dist-info}/entry_points.txt +0 -0
- {neuronum-5.5.0.dist-info → neuronum-5.7.0.dist-info}/licenses/LICENSE.md +0 -0
- {neuronum-5.5.0.dist-info → neuronum-5.7.0.dist-info}/top_level.txt +0 -0
cli/main.py
CHANGED
|
@@ -494,7 +494,7 @@ asyncio.run(main())
|
|
|
494
494
|
if app and nodeID:
|
|
495
495
|
|
|
496
496
|
descr = f"{nodeID} App"
|
|
497
|
-
partners = ["
|
|
497
|
+
partners = ["private"]
|
|
498
498
|
stxID = await cell.create_stx(descr, partners)
|
|
499
499
|
|
|
500
500
|
|
|
@@ -504,7 +504,7 @@ asyncio.run(main())
|
|
|
504
504
|
}
|
|
505
505
|
STX = stxID
|
|
506
506
|
label = "say:hello"
|
|
507
|
-
partners = ["
|
|
507
|
+
partners = ["private"]
|
|
508
508
|
txID = await cell.create_tx(descr, key_values, STX, label, partners)
|
|
509
509
|
|
|
510
510
|
|
|
@@ -919,6 +919,90 @@ async def async_activate(tx, data):
|
|
|
919
919
|
click.echo(tx_response)
|
|
920
920
|
|
|
921
921
|
|
|
922
|
+
@click.command()
|
|
923
|
+
@click.option('--ctx', required=True, help="Circuit ID")
|
|
924
|
+
@click.argument('label', nargs=-1)
|
|
925
|
+
def load(ctx, label):
|
|
926
|
+
if len(label) > 1 and all(Path(x).exists() for x in label):
|
|
927
|
+
label = "*"
|
|
928
|
+
else:
|
|
929
|
+
label = " ".join(label)
|
|
930
|
+
|
|
931
|
+
asyncio.run(async_load(ctx, label))
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
async def async_load(ctx, label):
|
|
935
|
+
credentials_folder_path = Path.home() / ".neuronum"
|
|
936
|
+
env_path = credentials_folder_path / ".env"
|
|
937
|
+
env_data = {}
|
|
938
|
+
|
|
939
|
+
try:
|
|
940
|
+
with open(env_path, "r") as f:
|
|
941
|
+
for line in f:
|
|
942
|
+
key, value = line.strip().split("=")
|
|
943
|
+
env_data[key] = value
|
|
944
|
+
except FileNotFoundError:
|
|
945
|
+
click.echo("No cell connected. Try: neuronum connect-cell")
|
|
946
|
+
return
|
|
947
|
+
except Exception as e:
|
|
948
|
+
click.echo(f"Error reading .env: {e}")
|
|
949
|
+
return
|
|
950
|
+
|
|
951
|
+
cell = neuronum.Cell(
|
|
952
|
+
host=env_data.get("HOST", ""),
|
|
953
|
+
password=env_data.get("PASSWORD", ""),
|
|
954
|
+
network=env_data.get("NETWORK", ""),
|
|
955
|
+
synapse=env_data.get("SYNAPSE", "")
|
|
956
|
+
)
|
|
957
|
+
|
|
958
|
+
data = await cell.load(label, ctx)
|
|
959
|
+
click.echo(data)
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
@click.command()
|
|
963
|
+
@click.option('--stx', default=None, help="Stream ID (optional)")
|
|
964
|
+
def sync(stx):
|
|
965
|
+
asyncio.run(async_sync(stx))
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
async def async_sync(stx):
|
|
969
|
+
credentials_folder_path = Path.home() / ".neuronum"
|
|
970
|
+
env_path = credentials_folder_path / ".env"
|
|
971
|
+
env_data = {}
|
|
972
|
+
|
|
973
|
+
try:
|
|
974
|
+
with open(env_path, "r") as f:
|
|
975
|
+
for line in f:
|
|
976
|
+
key, value = line.strip().split("=")
|
|
977
|
+
env_data[key] = value
|
|
978
|
+
except FileNotFoundError:
|
|
979
|
+
click.echo("No cell connected. Try: neuronum connect-cell")
|
|
980
|
+
return
|
|
981
|
+
except Exception as e:
|
|
982
|
+
click.echo(f"Error reading .env: {e}")
|
|
983
|
+
return
|
|
984
|
+
|
|
985
|
+
cell = neuronum.Cell(
|
|
986
|
+
host=env_data.get("HOST", ""),
|
|
987
|
+
password=env_data.get("PASSWORD", ""),
|
|
988
|
+
network=env_data.get("NETWORK", ""),
|
|
989
|
+
synapse=env_data.get("SYNAPSE", "")
|
|
990
|
+
)
|
|
991
|
+
|
|
992
|
+
if stx:
|
|
993
|
+
print(f"Listening to Stream '{stx}'! Close connection with CTRL+C")
|
|
994
|
+
else:
|
|
995
|
+
print(f"Listening to '{cell.host}' private Stream! Close connection with CTRL+C")
|
|
996
|
+
async for operation in cell.sync() if stx is None else cell.sync(stx):
|
|
997
|
+
label = operation.get("label")
|
|
998
|
+
data = operation.get("data")
|
|
999
|
+
ts = operation.get("time")
|
|
1000
|
+
stxID = operation.get("stxID")
|
|
1001
|
+
operator = operation.get("operator")
|
|
1002
|
+
txID = operation.get("txID")
|
|
1003
|
+
print(label, data, ts, operator, txID, stxID)
|
|
1004
|
+
|
|
1005
|
+
|
|
922
1006
|
cli.add_command(create_cell)
|
|
923
1007
|
cli.add_command(connect_cell)
|
|
924
1008
|
cli.add_command(view_cell)
|
|
@@ -932,6 +1016,8 @@ cli.add_command(update_node)
|
|
|
932
1016
|
cli.add_command(disconnect_node)
|
|
933
1017
|
cli.add_command(delete_node)
|
|
934
1018
|
cli.add_command(activate)
|
|
1019
|
+
cli.add_command(load)
|
|
1020
|
+
cli.add_command(sync)
|
|
935
1021
|
|
|
936
1022
|
|
|
937
1023
|
if __name__ == "__main__":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: neuronum
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.7.0
|
|
4
4
|
Summary: Official client library to interact with the Neuronum Network
|
|
5
5
|
Home-page: https://neuronum.net
|
|
6
6
|
Author: Neuronum Cybernetics
|
|
@@ -33,7 +33,7 @@ Dynamic: summary
|
|
|
33
33
|
<h1 align="center">
|
|
34
34
|
<img src="https://neuronum.net/static/neuronum.svg" alt="Neuronum" width="80">
|
|
35
35
|
</h1>
|
|
36
|
-
<h4 align="center">
|
|
36
|
+
<h4 align="center">Neuronum: A Serverless Data Network in Pure Python</h4>
|
|
37
37
|
|
|
38
38
|
<p align="center">
|
|
39
39
|
<a href="https://neuronum.net">
|
|
@@ -44,25 +44,32 @@ Dynamic: summary
|
|
|
44
44
|
</a>
|
|
45
45
|
<a href="https://pypi.org/project/neuronum/">
|
|
46
46
|
<img src="https://img.shields.io/pypi/v/neuronum.svg" alt="PyPI Version">
|
|
47
|
-
</a>
|
|
47
|
+
</a><br>
|
|
48
48
|
<img src="https://img.shields.io/badge/Python-3.8%2B-yellow" alt="Python Version">
|
|
49
49
|
<a href="https://github.com/neuronumcybernetics/neuronum/blob/main/LICENSE.md">
|
|
50
50
|
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License">
|
|
51
51
|
</a>
|
|
52
52
|
</p>
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
------------------
|
|
55
55
|
|
|
56
|
-
### **
|
|
57
|
-
|
|
56
|
+
### **A Getting Started into the Neuronum Network**
|
|
57
|
+
- Learn about Neuronum
|
|
58
|
+
- Connect to the Network
|
|
59
|
+
- Build a Neuronum Node
|
|
60
|
+
- Interact with your Node
|
|
58
61
|
|
|
62
|
+
------------------
|
|
63
|
+
|
|
64
|
+
### **About Neuronum**
|
|
65
|
+
Neuronum empowers developers to build & connect apps, services, and devices into serverless networks able to exchange data in real time
|
|
59
66
|
|
|
60
67
|
### **Features**
|
|
61
68
|
**Cell & Nodes**
|
|
62
69
|
- Cell: Account to connect and interact with Neuronum. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/cell)
|
|
63
|
-
- Nodes: Soft- and Hardware components hosting gateways. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/nodes)
|
|
70
|
+
- Nodes: Soft- and Hardware components hosting Neuronum data gateways. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/nodes)
|
|
64
71
|
|
|
65
|
-
**Gateways**
|
|
72
|
+
**Data Gateways**
|
|
66
73
|
- Transmitters (TX): Securely transmit and receive data packages. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/transmitters)
|
|
67
74
|
- Circuits (CTX): Store data in cloud-based key-value-label databases. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/circuits)
|
|
68
75
|
- Streams (STX): Stream, synchronize, and control data in real time. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/streams)
|
|
@@ -97,7 +104,7 @@ neuronum connect-cell # connect Cell
|
|
|
97
104
|
### **Build On Neuronum** **[(Build with Node Examples)](https://github.com/neuronumcybernetics/neuronum/tree/main/features/nodes)**
|
|
98
105
|
Initialize a Node (app template):
|
|
99
106
|
```sh
|
|
100
|
-
neuronum init-node --app # initialize a Node with app template
|
|
107
|
+
neuronum init-node --app # initialize a Node with app template -> creates a folder named node_<node_id> containing all relevant files
|
|
101
108
|
```
|
|
102
109
|
|
|
103
110
|
Change into Node folder
|
|
@@ -143,6 +150,6 @@ asyncio.run(main())
|
|
|
143
150
|
|
|
144
151
|
#### **CLI-based**
|
|
145
152
|
```sh
|
|
146
|
-
neuronum activate --tx id::tx say:hello
|
|
153
|
+
neuronum activate --tx id::tx 'say:hello'
|
|
147
154
|
```
|
|
148
155
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
cli/main.py,sha256=nishUFMtkKJqpCnmSTats30kymNYDIfknKLoesiztVs,31371
|
|
3
|
+
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
4
|
+
neuronum/neuronum.py,sha256=L8Oz1qcTyOiYMTGfiSKgN5Nu9jcl25jFeJOh0XItPjw,17201
|
|
5
|
+
neuronum-5.7.0.dist-info/licenses/LICENSE.md,sha256=zGst0rjgnp6oFuRVwFwB1Ql4sDXt_nw9xbUR49Gf99A,2008
|
|
6
|
+
neuronum-5.7.0.dist-info/METADATA,sha256=M7Q5CKsUO2uHGbPXQk43zq2FYFDPfWDnV29rZEW7A-8,5288
|
|
7
|
+
neuronum-5.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
neuronum-5.7.0.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
|
|
9
|
+
neuronum-5.7.0.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
|
|
10
|
+
neuronum-5.7.0.dist-info/RECORD,,
|
neuronum-5.5.0.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
cli/main.py,sha256=eCsEMdN0pbMjmKrIsMfH8auPtJdqMDHseBpZM_CeiUE,28704
|
|
3
|
-
neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
|
|
4
|
-
neuronum/neuronum.py,sha256=L8Oz1qcTyOiYMTGfiSKgN5Nu9jcl25jFeJOh0XItPjw,17201
|
|
5
|
-
neuronum-5.5.0.dist-info/licenses/LICENSE.md,sha256=zGst0rjgnp6oFuRVwFwB1Ql4sDXt_nw9xbUR49Gf99A,2008
|
|
6
|
-
neuronum-5.5.0.dist-info/METADATA,sha256=IHW67Dn-byFuRrUAyjWvxLD9CMP3DgpQkXHXcyQCyOk,5068
|
|
7
|
-
neuronum-5.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
neuronum-5.5.0.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
|
|
9
|
-
neuronum-5.5.0.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
|
|
10
|
-
neuronum-5.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|