neuronum 1.2.0__py3-none-any.whl → 1.2.1__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/neuronum.py CHANGED
@@ -3,6 +3,7 @@ import socket
3
3
  from typing import Optional
4
4
  import ssl
5
5
  from websocket import create_connection
6
+ from typing import List
6
7
 
7
8
 
8
9
  class Cell:
@@ -201,22 +202,29 @@ class Cell:
201
202
  return "Authentication successful" in response
202
203
 
203
204
 
204
- def sync(self, STX: str):
205
+ def sync(self, STX: str) -> List[str]:
206
+ data = []
205
207
  try:
206
208
  ws = create_connection(f"wss://{self.network}/ws/{STX}")
207
209
  print(f"Connected to Stream {STX}")
208
210
  except Exception as e:
209
211
  print(f"Failed to connect: {e}")
210
- return
212
+ return data
211
213
 
212
214
  try:
213
215
  while True:
214
216
  message = ws.recv()
215
217
  print(f"Received Data: {message}")
218
+ data.append(message)
216
219
  except KeyboardInterrupt:
217
220
  print("Closing connection...")
221
+ except Exception as e:
222
+ print(f"Error during data collection: {e}")
218
223
  finally:
219
224
  ws.close()
225
+ print("Connection closed.")
226
+
227
+ return data
220
228
 
221
229
 
222
230
  __all__ = ['Cell']
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neuronum
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Interact with the Neuronum Network to build, connect & automate economic data streams
5
- Home-page: https://github.com/neuronumcybernetics/neuronum
5
+ Home-page: https://neuronum.net
6
6
  Author: Neuronum Cybernetics
7
7
  Author-email: welcome@neuronum.net
8
+ Project-URL: GitHub, https://github.com/neuronumcybernetics/neuronum
8
9
  Classifier: Programming Language :: Python :: 3
9
10
  Classifier: License :: OSI Approved :: MIT License
10
11
  Classifier: Operating System :: OS Independent
@@ -61,7 +62,6 @@ data = {
61
62
  "key1": "value1",
62
63
  "key2": "value2",
63
64
  "key3": "value3",
64
- "key4": "value4"
65
65
  }
66
66
 
67
67
  cell.activate(TX, data)
@@ -136,5 +136,6 @@ cell.stream(data)
136
136
  Sync data:
137
137
  ```bash
138
138
  STX = "stx::id"
139
- cell.sync(STX)
139
+ data = cell.sync(STX)
140
140
  ```
141
+
@@ -0,0 +1,7 @@
1
+ neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
2
+ neuronum/neuronum.py,sha256=nn_vEskQyALPRXZTuWPn89kXqkut9vMPGC9t-WNaYzM,6999
3
+ neuronum-1.2.1.dist-info/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
4
+ neuronum-1.2.1.dist-info/METADATA,sha256=dmrkgRF0rbHh4q1tVI12uQBj4jg-5Lw4w3tvI9indy4,3214
5
+ neuronum-1.2.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
6
+ neuronum-1.2.1.dist-info/top_level.txt,sha256=73zXVVO9UTTiwEcSaXytsJ8n0q47OCwAqPlIh-hzWJU,9
7
+ neuronum-1.2.1.dist-info/RECORD,,
@@ -1,8 +0,0 @@
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,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- neuronum = neuronum.cli:main