neuronum 1.7.1__py3-none-any.whl → 2.0.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.

cellai/__init__.py ADDED
File without changes
cellai/cellai.py ADDED
@@ -0,0 +1,7 @@
1
+ def main():
2
+ print("Hello, it's your task assistant Cellai")
3
+ print("I'm still in development, but my creators are happy to share updates.")
4
+ print("Feel free to reach out to them at <welcome@neuronum.net> for more details.")
5
+
6
+ if __name__ == "__main__":
7
+ main()
cli/main.py CHANGED
@@ -6,6 +6,8 @@ import subprocess
6
6
  import os
7
7
  import neuronum
8
8
  import json
9
+ import sys
10
+ import cellai
9
11
 
10
12
  @click.group()
11
13
  def cli():
@@ -285,6 +287,7 @@ def init_node(sync):
285
287
  synapse=synapse
286
288
  )
287
289
 
290
+ cells = cell.list_cells()
288
291
  tx = cell.list_tx()
289
292
  ctx = cell.list_ctx()
290
293
  stx = cell.list_stx()
@@ -313,6 +316,9 @@ def init_node(sync):
313
316
  gitignore_path = project_path / ".gitignore"
314
317
  gitignore_path.write_text(f".env\n")
315
318
 
319
+ cells_path = Path("cells.json")
320
+ cells_path.write_text(json.dumps(cells, indent=4))
321
+
316
322
  tx_path = project_path / "transmitters.json"
317
323
  tx_path.write_text(json.dumps(tx, indent=4))
318
324
 
@@ -397,8 +403,6 @@ def stop_node():
397
403
  click.echo("Node stopped successfully!")
398
404
  except FileNotFoundError:
399
405
  click.echo("Error: No active node process found.")
400
- except Exception as e:
401
- click.echo(f"Error stopping node: {e}")
402
406
 
403
407
 
404
408
  @click.command()
@@ -516,18 +520,21 @@ def update_node():
516
520
  synapse=synapse
517
521
  )
518
522
 
523
+ cells = cell.list_cells()
519
524
  tx = cell.list_tx()
520
525
  ctx = cell.list_ctx()
521
526
  stx = cell.list_stx()
522
527
  contracts = cell.list_contracts()
523
528
  nodes = cell.list_nodes()
524
529
 
530
+ cells_path = Path("cells.json")
525
531
  tx_path = Path("transmitters.json")
526
532
  ctx_path = Path("circuits.json")
527
533
  stx_path = Path("streams.json")
528
534
  contracts_path = Path("contracts.json")
529
535
  nodes_path = Path("nodes.json")
530
536
 
537
+ cells_path.write_text(json.dumps(cells, indent=4))
531
538
  tx_path.write_text(json.dumps(tx, indent=4))
532
539
  ctx_path.write_text(json.dumps(ctx, indent=4))
533
540
  stx_path.write_text(json.dumps(stx, indent=4))
@@ -579,6 +586,14 @@ def delete_node():
579
586
  click.echo(f"Neuronum Node '{nodeID}' deleted!")
580
587
 
581
588
 
589
+ @click.command()
590
+ def call_cellai():
591
+ try:
592
+ from cellai import cellai
593
+ cellai.main()
594
+ except ImportError:
595
+ click.echo("Cellai not found. Please check the necessary dependencies.")
596
+
582
597
  cli.add_command(create_cell)
583
598
  cli.add_command(connect_cell)
584
599
  cli.add_command(view_cell)
@@ -590,6 +605,7 @@ cli.add_command(stop_node)
590
605
  cli.add_command(register_node)
591
606
  cli.add_command(update_node)
592
607
  cli.add_command(delete_node)
608
+ cli.add_command(call_cellai)
593
609
 
594
610
 
595
611
  if __name__ == "__main__":
neuronum/neuronum.py CHANGED
@@ -206,6 +206,23 @@ class Cell:
206
206
  print(f"Unexpected error: {e}")
207
207
 
208
208
 
209
+ def list_cells(self):
210
+ full_url = f"https://{self.network}/api/list_cells"
211
+
212
+ list_cells = {
213
+ "cell": self.to_dict()
214
+ }
215
+
216
+ try:
217
+ response = requests.get(full_url, json=list_cells)
218
+ response.raise_for_status()
219
+ return response.json()["Cells"]
220
+ except requests.exceptions.RequestException as e:
221
+ print(f"Error sending request: {e}")
222
+ except Exception as e:
223
+ print(f"Unexpected error: {e}")
224
+
225
+
209
226
  def list_tx(self):
210
227
  full_url = f"https://{self.network}/api/list_tx"
211
228
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: neuronum
3
- Version: 1.7.1
3
+ Version: 2.0.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
@@ -17,20 +17,35 @@ Requires-Dist: websocket-client
17
17
  Requires-Dist: click
18
18
  Requires-Dist: questionary
19
19
  Requires-Dist: python-dotenv
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: license-file
27
+ Dynamic: project-url
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
20
31
 
21
32
  ![Neuronum Logo](https://neuronum.net/static/logo_pip.png "Neuronum")
22
33
 
23
34
  [![Website](https://img.shields.io/badge/Website-Neuronum-blue)](https://neuronum.net) [![Documentation](https://img.shields.io/badge/Docs-Read%20now-green)](https://github.com/neuronumcybernetics/neuronum)
24
35
 
25
- Build, deploy and automate serverless IoT connectivity with `Neuronum`
36
+ Build, deploy and automate serverless data infrastructures for an interconnected world with `Neuronum`
26
37
 
27
- ## Features
38
+ ### **Neuronum 2.0.0 – What's New?**
39
+ - **Cellai**: A local running task assistant in development (version 0.0.1)
40
+
41
+ ### New Feature Set
28
42
  - **Cells/Cell-CLI**: Create and manage Neuronum Cells from the command line
29
43
  - **Nodes/Node-CLI**: Setup and manage Neuronum Nodes from the command line
30
44
  - **Transmitters (TX)**: Automate economic data transfer
31
45
  - **Circuits (CTX)**: Store data in Key-Value-Label databases
32
46
  - **Streams (STX)**: Stream, synchronize and control data in real time
33
47
  - **Contracts/Tokens**: Automate services exchange and authorization between Cells and Nodes
48
+ - **Cellai**: A local running task assistant in development (version 0.0.1)
34
49
 
35
50
  ### Installation
36
51
  Install the Neuronum library using pip:
@@ -66,6 +81,11 @@ Delete Cell:
66
81
  $ neuronum delete-cell
67
82
  ```
68
83
 
84
+ List Cells:
85
+ ```python
86
+ cellsList = cell.list_cells() # list Nodes
87
+ ```
88
+
69
89
  ### Nodes/Node-CLI
70
90
  Neuronum Nodes are soft- and hardware components that power the Neuronum Network, enabling seamless communication between Nodes and Cells
71
91
 
@@ -303,10 +323,10 @@ Contracts are predefined token-based rules to automate service exchange and auth
303
323
  Create a Contract:
304
324
  ```python
305
325
  descr = "Test Contract" # short description (max 25 characters)
306
- details = { # define token details
307
- "price_in_eur": False, # token price in EUR (int, float or False)
326
+ details = { # token details
308
327
  "max_usage": False, # max number of uses (int or False)
309
- "validity_in_min": False # token expiration time in min (int, float or False)
328
+ "validity_in_min": False, # token expiration time in min (int, float or False)
329
+ "expiration_date": False # expiration date (DD-MM-YYYY or False)
310
330
  }
311
331
  partners = ["id::cell", "id::cell"]
312
332
  contractID = cell.create_contract(descr, details, partners)
@@ -0,0 +1,12 @@
1
+ cellai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ cellai/cellai.py,sha256=g5oBz-Xx6T4-JWzUs-TJ4y9nHtDmA_IpXh_188OqAZA,281
3
+ cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ cli/main.py,sha256=iIhQ3a-LIuUI29yFm7GvZ6rmXouWpscI1HFVjFpmYlk,18341
5
+ neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
6
+ neuronum/neuronum.py,sha256=rkc16omTxjWBEgBXP0rCeab1S3lYDKz1zx_i-tdFjlY,17544
7
+ neuronum-2.0.0.dist-info/licenses/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
8
+ neuronum-2.0.0.dist-info/METADATA,sha256=z1GsCn8M5sQB5PhgqBHEI5p85jo38DnuxUleNGK3lpc,13639
9
+ neuronum-2.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ neuronum-2.0.0.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
11
+ neuronum-2.0.0.dist-info/top_level.txt,sha256=gqN5tyGnBKMPSzvWQONO4rpTf4gQPMi77O3KAKx88LQ,20
12
+ neuronum-2.0.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.1.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,2 +1,3 @@
1
+ cellai
1
2
  cli
2
3
  neuronum
@@ -1,10 +0,0 @@
1
- cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- cli/main.py,sha256=hjo8-q9M_DUm7_Xe2ynb6L6wIMq2jfWnlp1oH5tBQD4,17896
3
- neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
4
- neuronum/neuronum.py,sha256=91lOreL7TeD8VWdDCtS2xu7MO34taI4HEYr-Lpv6L9Y,17019
5
- neuronum-1.7.1.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
6
- neuronum-1.7.1.dist-info/METADATA,sha256=nDYzJ4gJGP9ZGX_3S0EEVyE0j7e64td3HH9wUkOrsTw,13000
7
- neuronum-1.7.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
8
- neuronum-1.7.1.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
9
- neuronum-1.7.1.dist-info/top_level.txt,sha256=ru8Fr84cHm6oHr_DcJ8-uaq3RTiuCRFIr6AC8V0zPu4,13
10
- neuronum-1.7.1.dist-info/RECORD,,