neuronum 1.1.1__py3-none-any.whl → 1.2.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.

neuronum/__init__.py CHANGED
@@ -1,5 +1,2 @@
1
- # neuronum/__init__.py
2
-
3
1
  from .neuronum import Cell
4
-
5
2
  __all__ = ['Cell']
neuronum/neuronum.py CHANGED
@@ -2,6 +2,7 @@ import requests
2
2
  import socket
3
3
  from typing import Optional
4
4
  import ssl
5
+ from websocket import create_connection
5
6
 
6
7
 
7
8
  class Cell:
@@ -200,5 +201,22 @@ class Cell:
200
201
  return "Authentication successful" in response
201
202
 
202
203
 
204
+ def sync(self, STX: str):
205
+ try:
206
+ ws = create_connection(f"wss://{self.network}/ws/{STX}")
207
+ print(f"Connected to Stream {STX}")
208
+ except Exception as e:
209
+ print(f"Failed to connect: {e}")
210
+ return
211
+
212
+ try:
213
+ while True:
214
+ message = ws.recv()
215
+ print(f"Received Data: {message}")
216
+ except KeyboardInterrupt:
217
+ print("Closing connection...")
218
+ finally:
219
+ ws.close()
220
+
203
221
 
204
222
  __all__ = ['Cell']
@@ -1,7 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neuronum
3
- Version: 1.1.1
3
+ Version: 1.2.0
4
4
  Summary: Interact with the Neuronum Network to build, connect & automate economic data streams
5
+ Home-page: https://github.com/neuronumcybernetics/neuronum
5
6
  Author: Neuronum Cybernetics
6
7
  Author-email: welcome@neuronum.net
7
8
  Classifier: Programming Language :: Python :: 3
@@ -11,18 +12,28 @@ Requires-Python: >=3.6
11
12
  Description-Content-Type: text/markdown
12
13
  License-File: LICENSE
13
14
  Requires-Dist: requests
15
+ Requires-Dist: websocket-client
14
16
 
15
17
  ![Neuronum Logo](https://neuronum.net/static/logo_pip.png "Neuronum")
16
- Interact with the `Neuronum Network` to build, connect & automate economic data streams.
18
+
17
19
  [![Website](https://img.shields.io/badge/Website-Neuronum-blue)](https://neuronum.net)
18
20
  [![Documentation](https://img.shields.io/badge/Docs-Read%20now-green)](https://neuronum.net/docs)
19
21
  [![Tutorials](https://img.shields.io/badge/Tutorials-Watch%20now-red)](https://www.youtube.com/@neuronumnet)
20
22
 
21
- ## Features
23
+ Interact with the `Neuronum Network` to build, connect & automate economic data streams.
24
+
25
+ ## Business Cell Features
22
26
  - **Transmitters (TX)**: Automate economic data transfer + Circuits Integration
23
27
  - **Circuits (CTX)**: A simple Key-Value-Label database to store economic data
24
28
  - **Streams (STX)**: Stream economic data to synchronize devices & databases in real time (beta)
25
29
 
30
+ ## Community Cell Features
31
+ - **Circuits (CTX)**: A simple Key-Value-Label database (perfect for testing and side projects)
32
+
33
+ ## Getting Started
34
+ Create your Neuronum Business/Community Cell: [Create Cell](https://neuronum.net/createcell)
35
+
36
+
26
37
  Install the Neuronum library using pip:
27
38
  ```bash
28
39
  pip install neuronum
@@ -33,10 +44,10 @@ Set & test Cell connection:
33
44
  import neuronum
34
45
 
35
46
  cell = neuronum.Cell(
36
- host="test::cell",
37
- password="test1234",
47
+ host="host::cell",
48
+ password="your_password",
38
49
  network="neuronum.net",
39
- synapse="testtesttesttesttesttesttesttest"
50
+ synapse="your_synapse"
40
51
  )
41
52
 
42
53
  cell.test_connection()
@@ -44,34 +55,55 @@ cell.test_connection()
44
55
 
45
56
  Activate Transmitter (TX):
46
57
  ```bash
47
- TX = "test_transmitter"
58
+ TX = "id::tx"
48
59
 
49
60
  data = {
50
- "key1": "value1",
51
- "key2": "value2",
52
- "key3": "value3",
53
- "key4": "value4"
61
+ "key1": "value1",
62
+ "key2": "value2",
63
+ "key3": "value3",
64
+ "key4": "value4"
54
65
  }
55
66
 
56
67
  cell.activate(TX, data)
57
68
  ```
58
69
 
59
- Store data on Circuit (CTX):
70
+ Store data on your private Circuit (CTX):
60
71
  ```bash
61
- CTX = "test::ctx"
72
+ label = "your_label"
73
+ data = {
74
+ "key1": "value1",
75
+ "key2": "value2",
76
+ "key3": "value3",
77
+ }
78
+ cell.store(label, data)
79
+ ```
80
+
81
+ Store data on a public Circuit (CTX):
82
+ ```bash
83
+ CTX = "id::ctx"
62
84
 
63
85
  label = "your_label"
64
86
  data = {
65
- "key1": "value1",
66
- "key2": "value2",
67
- "key3": "value3",
87
+ "key1": "value1",
88
+ "key2": "value2",
89
+ "key3": "value3",
68
90
  }
69
91
  cell.store(label, data, CTX)
70
92
  ```
71
93
 
72
- Load data from Circuit (CTX):
94
+ Load data from your private Circuit (CTX):
95
+ ```bash
96
+ label = "your_label"
97
+
98
+ data = cell.load(label)
99
+ key1 = data["key1"]
100
+ key2 = data["key2"]
101
+ key3 = data["key3"]
102
+ ```
103
+
104
+ Load data from a public Circuit (CTX):
73
105
  ```bash
74
- CTX = "test::ctx"
106
+ CTX = "id::ctx"
75
107
 
76
108
  label = "your_label"
77
109
 
@@ -79,12 +111,17 @@ data = cell.load(label, CTX)
79
111
  key1 = data["key1"]
80
112
  key2 = data["key2"]
81
113
  key3 = data["key3"]
82
- print(key1, key2, key3)
83
114
  ```
84
115
 
85
- Delete data from Circuit (CTX):
116
+ Delete data from your private Circuit (CTX):
86
117
  ```bash
87
- CTX = "test::ctx"
118
+ label = "your_label"
119
+ data = cell.delete(label)
120
+ ```
121
+
122
+ Delete data from a public Circuit (CTX):
123
+ ```bash
124
+ CTX = "id::ctx"
88
125
 
89
126
  label = "your_label"
90
127
  data = cell.delete(label, CTX)
@@ -95,3 +132,9 @@ Stream data:
95
132
  data = "your_data"
96
133
  cell.stream(data)
97
134
  ```
135
+
136
+ Sync data:
137
+ ```bash
138
+ STX = "stx::id"
139
+ cell.sync(STX)
140
+ ```
@@ -0,0 +1,8 @@
1
+ neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
2
+ neuronum/neuronum.py,sha256=06qogFQ_a3dOqa6dgvLadltcYj8mtnxAqBxsYafB2uU,6746
3
+ neuronum-1.2.0.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
4
+ neuronum-1.2.0.dist-info/METADATA,sha256=zEqH8GXUGxlrw5TtQQ4XwLp00TitmlkxscMA0JYd0Nw,3184
5
+ neuronum-1.2.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
6
+ neuronum-1.2.0.dist-info/entry_points.txt,sha256=HAUSjcFCB-PSkwnZQy9qEaelZmzS6EmTMjrhPynPKg8,47
7
+ neuronum-1.2.0.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
8
+ neuronum-1.2.0.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ neuronum = neuronum.cli:main
@@ -1,7 +0,0 @@
1
- neuronum/__init__.py,sha256=P0KTJMGY_eT3l5YzR4LHfl64KH5Qt_qhcrqf9Ld2G00,74
2
- neuronum/neuronum.py,sha256=gDzg9aN4jjaBnKLLD9YRSvmV1uffKZOBJb8Fv-WDtfM,6186
3
- neuronum-1.1.1.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
4
- neuronum-1.1.1.dist-info/METADATA,sha256=OCz3NpHCxRGCGaFV6zU6bm5bONeWVva8cEQvQ1Qcs2o,2321
5
- neuronum-1.1.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
6
- neuronum-1.1.1.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
7
- neuronum-1.1.1.dist-info/RECORD,,