neuronum 5.4.3__py3-none-any.whl → 5.6.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 CHANGED
@@ -319,6 +319,13 @@ async def async_init_node(sync, stream, app):
319
319
  gitignore_path = project_path / ".gitignore"
320
320
  await asyncio.to_thread(gitignore_path.write_text, ".env\n")
321
321
 
322
+ requirements_path = project_path / "requirements.txt"
323
+ requirements_content = """\
324
+ # Please add additional packages below if your Node uses more
325
+ neuronum
326
+ """
327
+ await asyncio.to_thread(requirements_path.write_text, requirements_content)
328
+
322
329
  nodemd_path = project_path / "NODE.md"
323
330
  await asyncio.to_thread(nodemd_path.write_text, """### NODE.md: How to interact with this Node
324
331
 
@@ -487,7 +494,7 @@ asyncio.run(main())
487
494
  if app and nodeID:
488
495
 
489
496
  descr = f"{nodeID} App"
490
- partners = ["public"]
497
+ partners = ["private"]
491
498
  stxID = await cell.create_stx(descr, partners)
492
499
 
493
500
 
@@ -497,7 +504,7 @@ asyncio.run(main())
497
504
  }
498
505
  STX = stxID
499
506
  label = "say:hello"
500
- partners = ["public"]
507
+ partners = ["private"]
501
508
  txID = await cell.create_tx(descr, key_values, STX, label, partners)
502
509
 
503
510
 
@@ -872,6 +879,87 @@ async def async_delete_node():
872
879
  click.echo(f"Neuronum Node '{nodeID}' deleted!")
873
880
 
874
881
 
882
+ @click.command()
883
+ @click.option('--tx', required=True, help="Transmitter ID")
884
+ @click.argument('kvpairs', nargs=-1)
885
+ def activate(tx, kvpairs):
886
+ try:
887
+ data = dict(pair.split(':', 1) for pair in kvpairs)
888
+ except ValueError:
889
+ click.echo("Invalid input. Use key:value pairs.")
890
+ return
891
+
892
+ asyncio.run(async_activate(tx, data))
893
+
894
+ async def async_activate(tx, data):
895
+ credentials_folder_path = Path.home() / ".neuronum"
896
+ env_path = credentials_folder_path / ".env"
897
+ env_data = {}
898
+
899
+ try:
900
+ with open(env_path, "r") as f:
901
+ for line in f:
902
+ key, value = line.strip().split("=")
903
+ env_data[key] = value
904
+ except FileNotFoundError:
905
+ click.echo("No cell connected. Try: neuronum connect-cell")
906
+ return
907
+ except Exception as e:
908
+ click.echo(f"Error reading .env: {e}")
909
+ return
910
+
911
+ cell = neuronum.Cell(
912
+ host=env_data.get("HOST", ""),
913
+ password=env_data.get("PASSWORD", ""),
914
+ network=env_data.get("NETWORK", ""),
915
+ synapse=env_data.get("SYNAPSE", "")
916
+ )
917
+
918
+ tx_response = await cell.activate_tx(tx, data)
919
+ click.echo(tx_response)
920
+
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
+ print(label, ctx)
959
+ data = await cell.load(label, ctx)
960
+ click.echo(data)
961
+
962
+
875
963
  cli.add_command(create_cell)
876
964
  cli.add_command(connect_cell)
877
965
  cli.add_command(view_cell)
@@ -884,6 +972,8 @@ cli.add_command(connect_node)
884
972
  cli.add_command(update_node)
885
973
  cli.add_command(disconnect_node)
886
974
  cli.add_command(delete_node)
975
+ cli.add_command(activate)
976
+ cli.add_command(load)
887
977
 
888
978
 
889
979
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neuronum
3
- Version: 5.4.3
3
+ Version: 5.6.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">Build, connect, and automate serverless data infrastructures with Neuronum</h4>
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,7 +44,7 @@ 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">
@@ -54,22 +54,22 @@ Dynamic: summary
54
54
  ---
55
55
 
56
56
  ### **About Neuronum**
57
- Neuronum is a python framework to build serverless connected app & data gateways automating the processing and distribution of real-time data transmission, storage, and streaming.
57
+ Neuronum empowers developers to build & connect apps, services, and devices into serverless networks able to exchange data in real time
58
58
 
59
59
 
60
60
  ### **Features**
61
61
  **Cell & Nodes**
62
62
  - 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)
63
+ - Nodes: Soft- and Hardware components hosting Neuronum data gateways. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/nodes)
64
64
 
65
- **Gateways**
65
+ **Data Gateways**
66
66
  - Transmitters (TX): Securely transmit and receive data packages. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/transmitters)
67
67
  - Circuits (CTX): Store data in cloud-based key-value-label databases. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/circuits)
68
68
  - Streams (STX): Stream, synchronize, and control data in real time. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/streams)
69
69
 
70
70
  ### Requirements
71
71
  - Python >= 3.8
72
- - neuronum >= 5.4.0
72
+ - neuronum >= 5.5.0
73
73
 
74
74
  ------------------
75
75
 
@@ -97,7 +97,7 @@ neuronum connect-cell # connect Cell
97
97
  ### **Build On Neuronum** **[(Build with Node Examples)](https://github.com/neuronumcybernetics/neuronum/tree/main/features/nodes)**
98
98
  Initialize a Node (app template):
99
99
  ```sh
100
- neuronum init-node --app # initialize a Node with app template
100
+ neuronum init-node --app # initialize a Node with app template -> creates a folder named node_<node_id> containing all relevant files
101
101
  ```
102
102
 
103
103
  Change into Node folder
@@ -120,7 +120,6 @@ neuronum start-node # start Node
120
120
  4. Activate Transmitters
121
121
 
122
122
  #### **Code-based**
123
- Activate Transmitters (TX) to send requests and receive responses
124
123
  ```python
125
124
  import asyncio
126
125
  import neuronum
@@ -134,13 +133,16 @@ cell = neuronum.Cell( # set Cell connection
134
133
 
135
134
  async def main():
136
135
 
137
- TX = txID # select the Transmitter TX
138
- data = {
139
- "say": "hello",
140
- }
136
+ TX = "id::tx" # select the Transmitter TX
137
+ data = {"say": "hello"}
141
138
  tx_response = await cell.activate_tx(TX, data) # activate TX - > get response back
142
- print(tx_response) # print Cell list
139
+ print(tx_response) # print tx response
143
140
 
144
141
  asyncio.run(main())
145
142
  ```
146
143
 
144
+ #### **CLI-based**
145
+ ```sh
146
+ neuronum activate --tx id::tx 'say:hello'
147
+ ```
148
+
@@ -0,0 +1,10 @@
1
+ cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ cli/main.py,sha256=WIU5suB-SFPzLswA0i6UyDuNhdevl3vWRAbuh0v4QQY,29888
3
+ neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
4
+ neuronum/neuronum.py,sha256=L8Oz1qcTyOiYMTGfiSKgN5Nu9jcl25jFeJOh0XItPjw,17201
5
+ neuronum-5.6.0.dist-info/licenses/LICENSE.md,sha256=zGst0rjgnp6oFuRVwFwB1Ql4sDXt_nw9xbUR49Gf99A,2008
6
+ neuronum-5.6.0.dist-info/METADATA,sha256=OyxgpKzGQNooCDdXYmOSb58cS18w-Zo3axD9WgPjSwQ,5096
7
+ neuronum-5.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ neuronum-5.6.0.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
9
+ neuronum-5.6.0.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
10
+ neuronum-5.6.0.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- cli/main.py,sha256=v16Fmnv6z3lTv0rn5NUXAOIrYIHTdiLa9Pky71TsaIA,27217
3
- neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
4
- neuronum/neuronum.py,sha256=L8Oz1qcTyOiYMTGfiSKgN5Nu9jcl25jFeJOh0XItPjw,17201
5
- neuronum-5.4.3.dist-info/licenses/LICENSE.md,sha256=zGst0rjgnp6oFuRVwFwB1Ql4sDXt_nw9xbUR49Gf99A,2008
6
- neuronum-5.4.3.dist-info/METADATA,sha256=go_X7AqeUzjQvD48wPA2qwKk-4i6Sv3KEHigNH_bJBs,5075
7
- neuronum-5.4.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- neuronum-5.4.3.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
9
- neuronum-5.4.3.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
10
- neuronum-5.4.3.dist-info/RECORD,,