neuronum 0.9.0__tar.gz → 1.0.1__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.
- neuronum-1.0.1/LICENSE +21 -0
- neuronum-1.0.1/PKG-INFO +38 -0
- neuronum-1.0.1/README.md +16 -0
- {neuronum-0.9.0 → neuronum-1.0.1}/neuronum/neuronum.py +83 -24
- neuronum-1.0.1/neuronum.egg-info/PKG-INFO +38 -0
- {neuronum-0.9.0 → neuronum-1.0.1}/neuronum.egg-info/SOURCES.txt +1 -0
- neuronum-1.0.1/setup.py +24 -0
- neuronum-0.9.0/PKG-INFO +0 -8
- neuronum-0.9.0/README.md +0 -8
- neuronum-0.9.0/neuronum.egg-info/PKG-INFO +0 -8
- neuronum-0.9.0/setup.py +0 -14
- {neuronum-0.9.0 → neuronum-1.0.1}/neuronum/__init__.py +0 -0
- {neuronum-0.9.0 → neuronum-1.0.1}/neuronum.egg-info/dependency_links.txt +0 -0
- {neuronum-0.9.0 → neuronum-1.0.1}/neuronum.egg-info/requires.txt +0 -0
- {neuronum-0.9.0 → neuronum-1.0.1}/neuronum.egg-info/top_level.txt +0 -0
- {neuronum-0.9.0 → neuronum-1.0.1}/setup.cfg +0 -0
neuronum-1.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [2025] [Neuronum Cybernetics UG (limited liability)]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
neuronum-1.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: neuronum
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Interact with the Neuronum Network to build, connect & automate economic data streams
|
|
5
|
+
Author: Neuronum Cybernetics
|
|
6
|
+
Author-email: welcome@neuronum.net
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.6
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: requests
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: classifier
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: requires-dist
|
|
20
|
+
Dynamic: requires-python
|
|
21
|
+
Dynamic: summary
|
|
22
|
+
|
|
23
|
+
# Neuronum
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
Interact with the `Neuronum` Network to build, connect & automate economic data streams.
|
|
28
|
+
|
|
29
|
+
## Links and Resources
|
|
30
|
+
[](https://www.neuronum.net)
|
|
31
|
+
[](https://www.neuronum.net/docs)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
Install the library using pip:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install neuronum
|
neuronum-1.0.1/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Neuronum
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Interact with the `Neuronum` Network to build, connect & automate economic data streams.
|
|
6
|
+
|
|
7
|
+
## Links and Resources
|
|
8
|
+
[](https://www.neuronum.net)
|
|
9
|
+
[](https://www.neuronum.net/docs)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
Install the library using pip:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install neuronum
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import requests
|
|
2
|
+
import socket
|
|
2
3
|
from typing import Optional
|
|
4
|
+
import ssl
|
|
3
5
|
|
|
4
6
|
|
|
5
7
|
class Cell:
|
|
@@ -8,6 +10,7 @@ class Cell:
|
|
|
8
10
|
self.password = password
|
|
9
11
|
self.network = network
|
|
10
12
|
self.synapse = synapse
|
|
13
|
+
self.sock = None
|
|
11
14
|
|
|
12
15
|
def to_dict(self) -> dict:
|
|
13
16
|
return {
|
|
@@ -19,7 +22,7 @@ class Cell:
|
|
|
19
22
|
def __repr__(self) -> str:
|
|
20
23
|
return f"Cell(host={self.host}, password={self.password}, network={self.network}, synapse={self.synapse})"
|
|
21
24
|
|
|
22
|
-
def activate(self, txID: str, data: dict, base_url: str = "
|
|
25
|
+
def activate(self, txID: str, data: dict, base_url: str = "https://{network}/activateTX"):
|
|
23
26
|
full_url = base_url.format(network=self.network) + f"/{txID}"
|
|
24
27
|
|
|
25
28
|
TX = {
|
|
@@ -44,39 +47,30 @@ class Cell:
|
|
|
44
47
|
|
|
45
48
|
|
|
46
49
|
|
|
47
|
-
def test_connection(self, base_url: str = "
|
|
50
|
+
def test_connection(self, base_url: str = "https://{network}/testConnection"):
|
|
48
51
|
full_url = base_url.format(network=self.network)
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
"host": self.host,
|
|
52
|
-
"password": self.password,
|
|
53
|
-
"synapse": self.synapse
|
|
54
|
-
}
|
|
53
|
+
print(f"Full URL: {full_url}")
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
test = {
|
|
56
|
+
"cell": self.to_dict()
|
|
57
|
+
}
|
|
57
58
|
|
|
58
59
|
try:
|
|
59
|
-
response = requests.post(
|
|
60
|
-
full_url,
|
|
61
|
-
json=TX,
|
|
62
|
-
)
|
|
63
|
-
|
|
60
|
+
response = requests.post(full_url, json=test)
|
|
64
61
|
response.raise_for_status()
|
|
65
|
-
print(
|
|
66
|
-
|
|
62
|
+
print(response.json())
|
|
67
63
|
except requests.exceptions.RequestException as e:
|
|
68
64
|
print(f"Error sending request: {e}")
|
|
69
65
|
except Exception as e:
|
|
70
66
|
print(f"Unexpected error: {e}")
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
|
|
75
69
|
def store(self, label: str, data: dict, ctx: Optional[str] = None):
|
|
76
70
|
if ctx:
|
|
77
|
-
full_url = f"
|
|
71
|
+
full_url = f"https://{self.network}/store_ctx/{ctx}"
|
|
78
72
|
else:
|
|
79
|
-
full_url = f"
|
|
73
|
+
full_url = f"https://{self.network}/store"
|
|
80
74
|
|
|
81
75
|
store = {
|
|
82
76
|
"label": label,
|
|
@@ -97,9 +91,9 @@ class Cell:
|
|
|
97
91
|
|
|
98
92
|
def load(self, label: str, ctx: Optional[str] = None):
|
|
99
93
|
if ctx:
|
|
100
|
-
full_url = f"
|
|
94
|
+
full_url = f"https://{self.network}/load_ctx/{ctx}"
|
|
101
95
|
else:
|
|
102
|
-
full_url = f"
|
|
96
|
+
full_url = f"https://{self.network}/load"
|
|
103
97
|
|
|
104
98
|
print(f"Full URL: {full_url}")
|
|
105
99
|
|
|
@@ -121,9 +115,9 @@ class Cell:
|
|
|
121
115
|
|
|
122
116
|
def delete(self, label: str, ctx: Optional[str] = None):
|
|
123
117
|
if ctx:
|
|
124
|
-
full_url = f"
|
|
118
|
+
full_url = f"https://{self.network}/delete_ctx/{ctx}"
|
|
125
119
|
else:
|
|
126
|
-
full_url = f"
|
|
120
|
+
full_url = f"https://{self.network}/delete"
|
|
127
121
|
|
|
128
122
|
print(f"Full URL: {full_url}")
|
|
129
123
|
|
|
@@ -142,4 +136,69 @@ class Cell:
|
|
|
142
136
|
print(f"Unexpected error: {e}")
|
|
143
137
|
|
|
144
138
|
|
|
139
|
+
def clear(self, ctx: Optional[str] = None):
|
|
140
|
+
if ctx:
|
|
141
|
+
full_url = f"https://{self.network}/clear_ctx/{ctx}"
|
|
142
|
+
else:
|
|
143
|
+
full_url = f"https://{self.network}/clear"
|
|
144
|
+
|
|
145
|
+
print(f"Full URL: {full_url}")
|
|
146
|
+
|
|
147
|
+
clear = {
|
|
148
|
+
"cell": self.to_dict()
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
try:
|
|
152
|
+
response = requests.post(full_url, json=clear)
|
|
153
|
+
response.raise_for_status()
|
|
154
|
+
print(response.json())
|
|
155
|
+
except requests.exceptions.RequestException as e:
|
|
156
|
+
print(f"Error sending request: {e}")
|
|
157
|
+
except Exception as e:
|
|
158
|
+
print(f"Unexpected error: {e}")
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def stream(self, data):
|
|
163
|
+
context = ssl.create_default_context()
|
|
164
|
+
context.check_hostname = True
|
|
165
|
+
context.verify_mode = ssl.CERT_REQUIRED
|
|
166
|
+
raw_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
167
|
+
self.sock = context.wrap_socket(raw_sock, server_hostname=self.network)
|
|
168
|
+
|
|
169
|
+
print("SSL socket set")
|
|
170
|
+
|
|
171
|
+
try:
|
|
172
|
+
print(f"Connecting to {self.network} on port 55555...")
|
|
173
|
+
self.sock.connect((self.network, 55555))
|
|
174
|
+
print("SSL socket connected")
|
|
175
|
+
|
|
176
|
+
if not self.authenticate(self.sock):
|
|
177
|
+
print("Authentication failed. Cannot stream.")
|
|
178
|
+
return
|
|
179
|
+
|
|
180
|
+
self.sock.sendall(data.encode('utf-8'))
|
|
181
|
+
print(f"Sent: {data}")
|
|
182
|
+
|
|
183
|
+
except ssl.SSLError as e:
|
|
184
|
+
print(f"SSL error occurred: {e}")
|
|
185
|
+
|
|
186
|
+
except Exception as e:
|
|
187
|
+
print(f"An unexpected error occurred: {e}")
|
|
188
|
+
|
|
189
|
+
finally:
|
|
190
|
+
self.sock.close()
|
|
191
|
+
print("SSL connection closed.")
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def authenticate(self, sock):
|
|
195
|
+
credentials = f"{self.host}\n{self.password}\n{self.synapse}\n"
|
|
196
|
+
sock.sendall(credentials.encode('utf-8'))
|
|
197
|
+
|
|
198
|
+
response = sock.recv(1024).decode('utf-8')
|
|
199
|
+
print(response)
|
|
200
|
+
return "Authentication successful" in response
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
145
204
|
__all__ = ['Cell']
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: neuronum
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Interact with the Neuronum Network to build, connect & automate economic data streams
|
|
5
|
+
Author: Neuronum Cybernetics
|
|
6
|
+
Author-email: welcome@neuronum.net
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.6
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: requests
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: classifier
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: requires-dist
|
|
20
|
+
Dynamic: requires-python
|
|
21
|
+
Dynamic: summary
|
|
22
|
+
|
|
23
|
+
# Neuronum
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
Interact with the `Neuronum` Network to build, connect & automate economic data streams.
|
|
28
|
+
|
|
29
|
+
## Links and Resources
|
|
30
|
+
[](https://www.neuronum.net)
|
|
31
|
+
[](https://www.neuronum.net/docs)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
Install the library using pip:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install neuronum
|
neuronum-1.0.1/setup.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
name='neuronum',
|
|
8
|
+
version='1.0.1',
|
|
9
|
+
author='Neuronum Cybernetics',
|
|
10
|
+
author_email='welcome@neuronum.net',
|
|
11
|
+
description='Interact with the Neuronum Network to build, connect & automate economic data streams',
|
|
12
|
+
long_description=open("README.md").read(),
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
packages=find_packages(),
|
|
15
|
+
classifiers=[
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
],
|
|
20
|
+
install_requires=[
|
|
21
|
+
'requests',
|
|
22
|
+
],
|
|
23
|
+
python_requires='>=3.6',
|
|
24
|
+
)
|
neuronum-0.9.0/PKG-INFO
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: neuronum
|
|
3
|
-
Version: 0.9.0
|
|
4
|
-
Summary: A high-level coding library to build & automate economic data streams - The Neuronum Team
|
|
5
|
-
Author: Neuronum Cybernetics
|
|
6
|
-
Author-email: welcome@neuronum.net
|
|
7
|
-
Requires-Python: >=3.6
|
|
8
|
-
Requires-Dist: requests
|
neuronum-0.9.0/README.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: neuronum
|
|
3
|
-
Version: 0.9.0
|
|
4
|
-
Summary: A high-level coding library to build & automate economic data streams - The Neuronum Team
|
|
5
|
-
Author: Neuronum Cybernetics
|
|
6
|
-
Author-email: welcome@neuronum.net
|
|
7
|
-
Requires-Python: >=3.6
|
|
8
|
-
Requires-Dist: requests
|
neuronum-0.9.0/setup.py
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
from setuptools import setup, find_packages
|
|
2
|
-
|
|
3
|
-
setup(
|
|
4
|
-
name='neuronum',
|
|
5
|
-
version='0.9.0',
|
|
6
|
-
author='Neuronum Cybernetics',
|
|
7
|
-
author_email='welcome@neuronum.net',
|
|
8
|
-
description='A high-level coding library to build & automate economic data streams - The Neuronum Team',
|
|
9
|
-
packages=find_packages(),
|
|
10
|
-
install_requires=[
|
|
11
|
-
'requests',
|
|
12
|
-
],
|
|
13
|
-
python_requires='>=3.6',
|
|
14
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|