neuronum 5.4.3__tar.gz → 5.5.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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neuronum
3
- Version: 5.4.3
3
+ Version: 5.5.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
@@ -69,7 +69,7 @@ Neuronum is a python framework to build serverless connected app & data gateways
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
 
@@ -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
+
@@ -37,7 +37,7 @@ Neuronum is a python framework to build serverless connected app & data gateways
37
37
 
38
38
  ### Requirements
39
39
  - Python >= 3.8
40
- - neuronum >= 5.4.0
40
+ - neuronum >= 5.5.0
41
41
 
42
42
  ------------------
43
43
 
@@ -88,7 +88,6 @@ neuronum start-node # start Node
88
88
  4. Activate Transmitters
89
89
 
90
90
  #### **Code-based**
91
- Activate Transmitters (TX) to send requests and receive responses
92
91
  ```python
93
92
  import asyncio
94
93
  import neuronum
@@ -102,13 +101,16 @@ cell = neuronum.Cell( # set Cell connection
102
101
 
103
102
  async def main():
104
103
 
105
- TX = txID # select the Transmitter TX
106
- data = {
107
- "say": "hello",
108
- }
104
+ TX = "id::tx" # select the Transmitter TX
105
+ data = {"say": "hello"}
109
106
  tx_response = await cell.activate_tx(TX, data) # activate TX - > get response back
110
- print(tx_response) # print Cell list
107
+ print(tx_response) # print tx response
111
108
 
112
109
  asyncio.run(main())
113
110
  ```
114
111
 
112
+ #### **CLI-based**
113
+ ```sh
114
+ neuronum activate --tx id::tx say:hello
115
+ ```
116
+
@@ -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
 
@@ -872,6 +879,46 @@ 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
+
875
922
  cli.add_command(create_cell)
876
923
  cli.add_command(connect_cell)
877
924
  cli.add_command(view_cell)
@@ -884,6 +931,7 @@ cli.add_command(connect_node)
884
931
  cli.add_command(update_node)
885
932
  cli.add_command(disconnect_node)
886
933
  cli.add_command(delete_node)
934
+ cli.add_command(activate)
887
935
 
888
936
 
889
937
  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.5.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
@@ -69,7 +69,7 @@ Neuronum is a python framework to build serverless connected app & data gateways
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
 
@@ -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
+
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='neuronum',
5
- version='5.4.3',
5
+ version='5.5.0',
6
6
  author='Neuronum Cybernetics',
7
7
  author_email='welcome@neuronum.net',
8
8
  description='Official client library to interact with the Neuronum Network',
File without changes
File without changes
File without changes
File without changes
File without changes