neuronum 5.4.2__py3-none-any.whl → 5.5.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
 
@@ -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__":
neuronum/neuronum.py CHANGED
@@ -172,13 +172,10 @@ class Cell:
172
172
  async with session.post(url, json=TX) as response:
173
173
  response.raise_for_status()
174
174
  data = await response.json()
175
- if data.get("success") == "activated":
176
- async for operation in self.sync():
177
- if operation.get("label") == "tx_response" and operation.get("txID") == txID:
178
- data = operation.get("data", {})
179
- if "json" in data:
180
- return data
181
- elif "html" in data:
175
+ if data.get("success") == True:
176
+ if "json" in data.get("response"):
177
+ return data.get("response").get("json")
178
+ elif "html" in data.get("response"):
182
179
  return "Info: HTML response available. Please activate TX in browser."
183
180
  else:
184
181
  return "Info: Response received but contains no usable content."
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neuronum
3
- Version: 5.4.2
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
@@ -11,7 +11,7 @@ Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
- License-File: LICENSE
14
+ License-File: LICENSE.md
15
15
  Requires-Dist: aiohttp
16
16
  Requires-Dist: websockets
17
17
  Requires-Dist: click
@@ -31,7 +31,7 @@ Dynamic: requires-python
31
31
  Dynamic: summary
32
32
 
33
33
  <h1 align="center">
34
- <img src="https://neuronum.net/static/neuronum.svg" alt="Neuronum" width="100">
34
+ <img src="https://neuronum.net/static/neuronum.svg" alt="Neuronum" width="80">
35
35
  </h1>
36
36
  <h4 align="center">Build, connect, and automate serverless data infrastructures with Neuronum</h4>
37
37
 
@@ -42,55 +42,51 @@ Dynamic: summary
42
42
  <a href="https://github.com/neuronumcybernetics/neuronum">
43
43
  <img src="https://img.shields.io/badge/Docs-Read%20now-green" alt="Documentation">
44
44
  </a>
45
- <img src="https://img.shields.io/badge/Version-5.4.0-blueviolet" alt="Lib Version">
46
- <img src="https://img.shields.io/badge/Python-3.9%2B-yellow" alt="Python Version">
45
+ <a href="https://pypi.org/project/neuronum/">
46
+ <img src="https://img.shields.io/pypi/v/neuronum.svg" alt="PyPI Version">
47
+ </a>
48
+ <img src="https://img.shields.io/badge/Python-3.8%2B-yellow" alt="Python Version">
49
+ <a href="https://github.com/neuronumcybernetics/neuronum/blob/main/LICENSE.md">
50
+ <img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License">
51
+ </a>
47
52
  </p>
48
53
 
49
54
  ---
50
55
 
51
- ## **Getting Started Goals**
52
- - Learn about Neuronum
53
- - Connect to Neuronum
54
- - Build on Neuronum
55
- - Interact with Neuronum
56
-
57
-
58
56
  ### **About Neuronum**
59
- Neuronum is a framework to build serverless connected app & data gateways automating the processing and distribution of data transmission, storage, and streaming.
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.
60
58
 
61
59
 
62
60
  ### **Features**
63
61
  **Cell & Nodes**
64
- - Cell: Account to connect and interact with Neuronum
65
- - Nodes: Soft- and Hardware components hosting gateways
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)
66
64
 
67
65
  **Gateways**
68
- - Transmitters (TX): Securely transmit and receive data packages
69
- - Circuits (CTX): Store data in cloud-based key-value-label databases
70
- - Streams (STX): Stream, synchronize, and control data in real time
71
-
72
- #### Requirements
73
- - Python >= 3.8 -> https://www.python.org/downloads/
74
- - neuronum >= 5.4.0 -> https://pypi.org/project/neuronum/
66
+ - Transmitters (TX): Securely transmit and receive data packages. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/transmitters)
67
+ - Circuits (CTX): Store data in cloud-based key-value-label databases. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/circuits)
68
+ - Streams (STX): Stream, synchronize, and control data in real time. [Learn More](https://github.com/neuronumcybernetics/neuronum/tree/main/features/streams)
75
69
 
70
+ ### Requirements
71
+ - Python >= 3.8
72
+ - neuronum >= 5.5.0
76
73
 
77
74
  ------------------
78
75
 
79
-
80
- ### **Connect to Neuronum**
81
- Installation
76
+ ### **Connect To Neuronum**
77
+ Installation (optional but recommended: create a virtual environment)
82
78
  ```sh
83
- pip install neuronum # install neuronum dependencies
79
+ pip install neuronum # install Neuronum dependencies
84
80
  ```
85
81
 
86
- Create Cell:
82
+ Create your Cell:
87
83
  ```sh
88
84
  neuronum create-cell # create Cell / Cell type / Cell network
89
85
  ```
90
86
 
91
87
  or
92
88
 
93
- Connect Cell:
89
+ Connect your Cell:
94
90
  ```sh
95
91
  neuronum connect-cell # connect Cell
96
92
  ```
@@ -98,8 +94,8 @@ neuronum connect-cell # connect Cell
98
94
  ------------------
99
95
 
100
96
 
101
- ### **Build on Neuronum**
102
- Initialize Node (app template):
97
+ ### **Build On Neuronum** **[(Build with Node Examples)](https://github.com/neuronumcybernetics/neuronum/tree/main/features/nodes)**
98
+ Initialize a Node (app template):
103
99
  ```sh
104
100
  neuronum init-node --app # initialize a Node with app template
105
101
  ```
@@ -109,26 +105,21 @@ Change into Node folder
109
105
  cd node_node_id # change directory
110
106
  ```
111
107
 
112
- Start Node:
108
+ Start your Node:
113
109
  ```sh
114
110
  neuronum start-node # start Node
115
111
  ```
116
112
 
117
- **Node Examples**
118
- Visit: https://github.com/neuronumcybernetics/neuronum/tree/main/how_tos/nodes
119
-
120
-
121
113
  ------------------
122
114
 
123
-
124
115
  ### **Interact with Neuronum**
125
- **Web-based**
126
- 1. Visit: https://neuronum.net
127
- 2. Connect your Cell
128
- 3. Explore Transmitters
116
+ #### **Web-based**
117
+ 1. [Visit Neuronum](https://neuronum.net)
118
+ 2. [Connect your Cell](https://neuronum.net/connect)
119
+ 3. [Explore Transmitters](https://neuronum.net/explore)
129
120
  4. Activate Transmitters
130
121
 
131
- **Code-based**
122
+ #### **Code-based**
132
123
  ```python
133
124
  import asyncio
134
125
  import neuronum
@@ -142,13 +133,16 @@ cell = neuronum.Cell( # set Cell connection
142
133
 
143
134
  async def main():
144
135
 
145
- TX = txID # select the Transmitter TX
146
- data = {
147
- "say": "hello",
148
- }
136
+ TX = "id::tx" # select the Transmitter TX
137
+ data = {"say": "hello"}
149
138
  tx_response = await cell.activate_tx(TX, data) # activate TX - > get response back
150
- print(tx_response) # print Cell list
139
+ print(tx_response) # print tx response
151
140
 
152
141
  asyncio.run(main())
153
142
  ```
154
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=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,,
@@ -1,6 +1,29 @@
1
+ <h1 align="center">
2
+ <img src="https://neuronum.net/static/neuronum.svg" alt="Neuronum" width="80">
3
+ </h1>
4
+ <h4 align="center">LICENSE of the Neuronum library</h4>
5
+
6
+ <p align="center">
7
+ <a href="https://neuronum.net">
8
+ <img src="https://img.shields.io/badge/Website-Neuronum-blue" alt="Website">
9
+ </a>
10
+ <a href="https://github.com/neuronumcybernetics/neuronum">
11
+ <img src="https://img.shields.io/badge/Docs-Read%20now-green" alt="Documentation">
12
+ </a>
13
+ <a href="https://pypi.org/project/neuronum/">
14
+ <img src="https://img.shields.io/pypi/v/neuronum.svg" alt="PyPI Version">
15
+ </a>
16
+ <img src="https://img.shields.io/badge/Python-3.8%2B-yellow" alt="Python Version">
17
+ <a href="https://github.com/neuronumcybernetics/neuronum/blob/main/LICENSE.md">
18
+ <img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License">
19
+ </a>
20
+ </p>
21
+
22
+ ---
23
+
1
24
  MIT License
2
25
 
3
- Copyright (c) [2025] [Neuronum Cybernetics UG (limited liability)]
26
+ Copyright (c) 2025 Neuronum Cybernetics UG (limited liability)
4
27
 
5
28
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
29
  of this software and associated documentation files (the "Software"), to deal
@@ -19,3 +42,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
42
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
43
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
44
  SOFTWARE.
45
+
46
+
47
+
@@ -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=gaQTvv8llmc36yBG8UwijCOoi6_uvifJyJ4z3KuiQqQ,17382
5
- neuronum-5.4.2.dist-info/licenses/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
6
- neuronum-5.4.2.dist-info/METADATA,sha256=EIxdXRjiEcH9yGwYSWIuIV6aHKNDvoW09X9Q8Yjlm9A,4364
7
- neuronum-5.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- neuronum-5.4.2.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
9
- neuronum-5.4.2.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
10
- neuronum-5.4.2.dist-info/RECORD,,