vnai 0.1.2__py3-none-any.whl → 0.1.4__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.
vnai/__init__.py
CHANGED
@@ -1,315 +1,319 @@
|
|
1
|
-
import os
|
2
|
-
import pathlib
|
3
|
-
import importlib.metadata
|
4
|
-
import requests
|
5
|
-
import psutil
|
6
|
-
import platform
|
7
|
-
import uuid
|
8
|
-
import sys
|
9
|
-
import socket
|
10
|
-
import json
|
11
|
-
import base64
|
12
|
-
from cryptography.fernet import Fernet
|
13
|
-
|
14
|
-
TC_VAR = "ACCEPT_TC"
|
15
|
-
TC_VAL = "tôi đồng ý"
|
16
|
-
|
17
|
-
lmt = os.path.sep
|
18
|
-
HOME_DIR = pathlib.Path.home()
|
19
|
-
PROJECT_DIR = HOME_DIR / ".vnstock"
|
20
|
-
ID_DIR = PROJECT_DIR / 'id'
|
21
|
-
TG = b'gAAAAABmOPXPmFYXs94INEralMxhR38geFp91TZRLP29C41OoO0k7D7QiXIR2nWl5PCEoQCKECZw8b-Xeek3oqT6LcpcpJsAPyOGOBTX5cw_r5Mv0o8SBLa53jOeuVAwCAhId_BpMtOO'
|
22
|
-
TC_PATH = ID_DIR / "terms_agreement.txt"
|
23
|
-
|
24
|
-
TERMS_AND_CONDITIONS = """
|
25
|
-
Khi tiếp tục sử dụng Vnstock3, bạn xác nhận rằng bạn đã đọc, hiểu và đồng ý với Chính sách quyền riêng tư và Điều khoản, điều kiện về giấy phép sử dụng Vnstock3.\n
|
26
|
-
Chi tiết:\n
|
27
|
-
-
|
28
|
-
-
|
29
|
-
"""
|
30
|
-
|
31
|
-
class VnstockInitializer:
|
32
|
-
def __init__(self, target, tc=TERMS_AND_CONDITIONS):
|
33
|
-
self.terms_and_conditions = tc
|
34
|
-
self.home_dir = HOME_DIR
|
35
|
-
self.project_dir = PROJECT_DIR
|
36
|
-
self.id_dir = ID_DIR
|
37
|
-
self.terms_file_path = TC_PATH
|
38
|
-
self.env_config = ID_DIR / "environment.json"
|
39
|
-
self.RH = 'asejruyy^&%$#W2vX>NfwrevDRESWR'
|
40
|
-
self.LH = 'YMAnhuytr%$59u90y7j-mjhgvyFTfbiuUYH'
|
41
|
-
|
42
|
-
# Create the project directory if it doesn't exist
|
43
|
-
self.project_dir.mkdir(exist_ok=True)
|
44
|
-
self.id_dir.mkdir(exist_ok=True)
|
45
|
-
self.target = target
|
46
|
-
|
47
|
-
kb = (str(self.project_dir).split(lmt)[-1] + str(self.id_dir).split(lmt)[-1] + str(self.terms_file_path).split(lmt)[-1]).ljust(32)[:32].encode('utf-8')
|
48
|
-
kb64 = base64.urlsafe_b64encode(kb)
|
49
|
-
self.cph = Fernet(kb64)
|
50
|
-
|
51
|
-
def system_info(self):
|
52
|
-
"""
|
53
|
-
Gathers information about the environment and system.
|
54
|
-
"""
|
55
|
-
# Generate UUID
|
56
|
-
machine_id = str(uuid.uuid4())
|
57
|
-
|
58
|
-
# Environment (modify to detect your specific frameworks)
|
59
|
-
try:
|
60
|
-
from IPython import get_ipython
|
61
|
-
if 'IPKernelApp' not in get_ipython().config: # Check if not in IPython kernel
|
62
|
-
if sys.stdout.isatty():
|
63
|
-
environment = "Terminal"
|
64
|
-
else:
|
65
|
-
environment = "Other" # Non-interactive environment (e.g., script executed from an IDE)
|
66
|
-
else:
|
67
|
-
environment = "Jupyter"
|
68
|
-
except (ImportError, AttributeError):
|
69
|
-
# Fallback if IPython isn't installed or other checks fail
|
70
|
-
if sys.stdout.isatty():
|
71
|
-
environment = "Terminal"
|
72
|
-
else:
|
73
|
-
environment = "Other"
|
74
|
-
|
75
|
-
try:
|
76
|
-
if 'google.colab' in sys.modules:
|
77
|
-
hosting_service = "Google Colab"
|
78
|
-
elif 'CODESPACE_NAME' in os.environ:
|
79
|
-
hosting_service = "Github Codespace"
|
80
|
-
elif 'GITPOD_WORKSPACE_CLUSTER_HOST' in os.environ:
|
81
|
-
hosting_service = "Gitpod"
|
82
|
-
elif 'REPLIT_USER' in os.environ:
|
83
|
-
hosting_service = "Replit"
|
84
|
-
elif 'KAGGLE_CONTAINER_NAME' in os.environ:
|
85
|
-
hosting_service = "Kaggle"
|
86
|
-
elif '.hf.space' in os.environ['SPACE_HOST']:
|
87
|
-
hosting_service = "Hugging Face Spaces"
|
88
|
-
except:
|
89
|
-
hosting_service = "Local or Unknown"
|
90
|
-
|
91
|
-
# System information
|
92
|
-
os_info = platform.uname()
|
93
|
-
|
94
|
-
# CPU information
|
95
|
-
cpu_arch = platform.processor()
|
96
|
-
cpu_logical_cores = psutil.cpu_count(logical=True)
|
97
|
-
cpu_cores = psutil.cpu_count(logical=False)
|
98
|
-
|
99
|
-
# Memory information
|
100
|
-
ram_total = psutil.virtual_memory().total / (1024**3) # GB
|
101
|
-
ram_available = psutil.virtual_memory().available / (1024**3) # GB
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
"
|
115
|
-
"
|
116
|
-
"
|
117
|
-
"
|
118
|
-
"
|
119
|
-
"
|
120
|
-
"
|
121
|
-
"
|
122
|
-
"
|
123
|
-
"
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
"
|
210
|
-
"
|
211
|
-
"
|
212
|
-
"
|
213
|
-
|
214
|
-
|
215
|
-
"
|
216
|
-
"
|
217
|
-
],
|
218
|
-
"
|
219
|
-
"
|
220
|
-
"
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
"
|
225
|
-
"
|
226
|
-
|
227
|
-
|
228
|
-
"
|
229
|
-
|
230
|
-
|
231
|
-
"
|
232
|
-
"
|
233
|
-
|
234
|
-
|
235
|
-
"
|
236
|
-
"
|
237
|
-
"
|
238
|
-
"
|
239
|
-
|
240
|
-
|
241
|
-
"
|
242
|
-
"
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
"
|
248
|
-
"
|
249
|
-
],
|
250
|
-
"
|
251
|
-
"
|
252
|
-
"
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
"
|
258
|
-
"
|
259
|
-
|
260
|
-
|
261
|
-
"
|
262
|
-
"
|
263
|
-
"
|
264
|
-
|
265
|
-
|
266
|
-
"
|
267
|
-
"
|
268
|
-
|
269
|
-
|
270
|
-
"
|
271
|
-
"
|
272
|
-
|
273
|
-
|
274
|
-
"
|
275
|
-
"
|
276
|
-
|
277
|
-
|
278
|
-
"
|
279
|
-
"
|
280
|
-
"
|
281
|
-
"
|
282
|
-
"
|
283
|
-
"
|
284
|
-
"
|
285
|
-
"
|
286
|
-
|
287
|
-
|
288
|
-
"
|
289
|
-
"
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
"
|
295
|
-
"
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
1
|
+
import os
|
2
|
+
import pathlib
|
3
|
+
import importlib.metadata
|
4
|
+
import requests
|
5
|
+
import psutil
|
6
|
+
import platform
|
7
|
+
import uuid
|
8
|
+
import sys
|
9
|
+
import socket
|
10
|
+
import json
|
11
|
+
import base64
|
12
|
+
from cryptography.fernet import Fernet
|
13
|
+
|
14
|
+
TC_VAR = "ACCEPT_TC"
|
15
|
+
TC_VAL = "tôi đồng ý"
|
16
|
+
|
17
|
+
lmt = os.path.sep
|
18
|
+
HOME_DIR = pathlib.Path.home()
|
19
|
+
PROJECT_DIR = HOME_DIR / ".vnstock"
|
20
|
+
ID_DIR = PROJECT_DIR / 'id'
|
21
|
+
TG = b'gAAAAABmOPXPmFYXs94INEralMxhR38geFp91TZRLP29C41OoO0k7D7QiXIR2nWl5PCEoQCKECZw8b-Xeek3oqT6LcpcpJsAPyOGOBTX5cw_r5Mv0o8SBLa53jOeuVAwCAhId_BpMtOO'
|
22
|
+
TC_PATH = ID_DIR / "terms_agreement.txt"
|
23
|
+
|
24
|
+
TERMS_AND_CONDITIONS = """
|
25
|
+
Khi tiếp tục sử dụng Vnstock3, bạn xác nhận rằng bạn đã đọc, hiểu và đồng ý với Chính sách quyền riêng tư và Điều khoản, điều kiện về giấy phép sử dụng Vnstock3.\n
|
26
|
+
Chi tiết:\n
|
27
|
+
- Giấy phép sử dụng phần mềm: https://vnstocks.com/docs/tai-lieu/giay-phep-su-dung
|
28
|
+
- Chính sách quyền riêng tư: https://vnstocks.com/docs/tai-lieu/chinh-sach-quyen-rieng-tu
|
29
|
+
"""
|
30
|
+
|
31
|
+
class VnstockInitializer:
|
32
|
+
def __init__(self, target, tc=TERMS_AND_CONDITIONS):
|
33
|
+
self.terms_and_conditions = tc
|
34
|
+
self.home_dir = HOME_DIR
|
35
|
+
self.project_dir = PROJECT_DIR
|
36
|
+
self.id_dir = ID_DIR
|
37
|
+
self.terms_file_path = TC_PATH
|
38
|
+
self.env_config = ID_DIR / "environment.json"
|
39
|
+
self.RH = 'asejruyy^&%$#W2vX>NfwrevDRESWR'
|
40
|
+
self.LH = 'YMAnhuytr%$59u90y7j-mjhgvyFTfbiuUYH'
|
41
|
+
|
42
|
+
# Create the project directory if it doesn't exist
|
43
|
+
self.project_dir.mkdir(exist_ok=True)
|
44
|
+
self.id_dir.mkdir(exist_ok=True)
|
45
|
+
self.target = target
|
46
|
+
|
47
|
+
kb = (str(self.project_dir).split(lmt)[-1] + str(self.id_dir).split(lmt)[-1] + str(self.terms_file_path).split(lmt)[-1]).ljust(32)[:32].encode('utf-8')
|
48
|
+
kb64 = base64.urlsafe_b64encode(kb)
|
49
|
+
self.cph = Fernet(kb64)
|
50
|
+
|
51
|
+
def system_info(self):
|
52
|
+
"""
|
53
|
+
Gathers information about the environment and system.
|
54
|
+
"""
|
55
|
+
# Generate UUID
|
56
|
+
machine_id = str(uuid.uuid4())
|
57
|
+
|
58
|
+
# Environment (modify to detect your specific frameworks)
|
59
|
+
try:
|
60
|
+
from IPython import get_ipython
|
61
|
+
if 'IPKernelApp' not in get_ipython().config: # Check if not in IPython kernel
|
62
|
+
if sys.stdout.isatty():
|
63
|
+
environment = "Terminal"
|
64
|
+
else:
|
65
|
+
environment = "Other" # Non-interactive environment (e.g., script executed from an IDE)
|
66
|
+
else:
|
67
|
+
environment = "Jupyter"
|
68
|
+
except (ImportError, AttributeError):
|
69
|
+
# Fallback if IPython isn't installed or other checks fail
|
70
|
+
if sys.stdout.isatty():
|
71
|
+
environment = "Terminal"
|
72
|
+
else:
|
73
|
+
environment = "Other"
|
74
|
+
|
75
|
+
try:
|
76
|
+
if 'google.colab' in sys.modules:
|
77
|
+
hosting_service = "Google Colab"
|
78
|
+
elif 'CODESPACE_NAME' in os.environ:
|
79
|
+
hosting_service = "Github Codespace"
|
80
|
+
elif 'GITPOD_WORKSPACE_CLUSTER_HOST' in os.environ:
|
81
|
+
hosting_service = "Gitpod"
|
82
|
+
elif 'REPLIT_USER' in os.environ:
|
83
|
+
hosting_service = "Replit"
|
84
|
+
elif 'KAGGLE_CONTAINER_NAME' in os.environ:
|
85
|
+
hosting_service = "Kaggle"
|
86
|
+
elif '.hf.space' in os.environ['SPACE_HOST']:
|
87
|
+
hosting_service = "Hugging Face Spaces"
|
88
|
+
except:
|
89
|
+
hosting_service = "Local or Unknown"
|
90
|
+
|
91
|
+
# System information
|
92
|
+
os_info = platform.uname()
|
93
|
+
|
94
|
+
# CPU information
|
95
|
+
cpu_arch = platform.processor()
|
96
|
+
cpu_logical_cores = psutil.cpu_count(logical=True)
|
97
|
+
cpu_cores = psutil.cpu_count(logical=False)
|
98
|
+
|
99
|
+
# Memory information
|
100
|
+
ram_total = psutil.virtual_memory().total / (1024**3) # GB
|
101
|
+
ram_available = psutil.virtual_memory().available / (1024**3) # GB
|
102
|
+
|
103
|
+
try:
|
104
|
+
hostname = socket.gethostname()
|
105
|
+
IPAddr = socket.gethostbyname(hostname)
|
106
|
+
except socket.gaierror:
|
107
|
+
hostname = "unknown"
|
108
|
+
IPAddr = "127.0.0.1" # Fallback to localhost
|
109
|
+
|
110
|
+
mac = ':'.join(['{:02x}'.format((uuid.getnode() >> elements) & 0xff) for elements in range(0, 2 * 6, 2)])
|
111
|
+
|
112
|
+
# Combine information into a dictionary
|
113
|
+
info = {
|
114
|
+
"uuid": machine_id,
|
115
|
+
"environment": environment,
|
116
|
+
"hosting_service": hosting_service,
|
117
|
+
"python_version": platform.python_version(),
|
118
|
+
"os_name": os_info.system,
|
119
|
+
"os_version": os_info.version,
|
120
|
+
"machine": os_info.machine,
|
121
|
+
"cpu_model": cpu_arch,
|
122
|
+
"cpu_cores": cpu_cores,
|
123
|
+
"cpu_logical_cores": cpu_logical_cores,
|
124
|
+
"ram_total": round(ram_total, 1),
|
125
|
+
"ram_available": round(ram_available, 1),
|
126
|
+
"local_ip": IPAddr,
|
127
|
+
"mac_address": mac,
|
128
|
+
}
|
129
|
+
|
130
|
+
return info
|
131
|
+
|
132
|
+
def show_terms_and_conditions(self):
|
133
|
+
"""
|
134
|
+
Displays terms and conditions and asks for acceptance.
|
135
|
+
"""
|
136
|
+
print(self.terms_and_conditions)
|
137
|
+
|
138
|
+
# check if os.environ[TC_VAR] exist and equal to tôi đồng ý
|
139
|
+
if TC_VAR in os.environ and os.environ[TC_VAR] == TC_VAL:
|
140
|
+
response = TC_VAL
|
141
|
+
else:
|
142
|
+
response = TC_VAL
|
143
|
+
os.environ[TC_VAR] = TC_VAL
|
144
|
+
|
145
|
+
from datetime import datetime
|
146
|
+
# get now time in string
|
147
|
+
now = datetime.now()
|
148
|
+
HARDWARE = self.system_info()
|
149
|
+
# VERSION = pkg_resources.get_distribution('vnstock').version
|
150
|
+
|
151
|
+
VERSION = None
|
152
|
+
try:
|
153
|
+
VERSION = importlib.metadata.version('vnstock')
|
154
|
+
except importlib.metadata.PackageNotFoundError:
|
155
|
+
# print("Package 'vnstock' not found")
|
156
|
+
pass
|
157
|
+
|
158
|
+
# parse HARDWARE to string to store in the file
|
159
|
+
signed_aggreement = f"MÔ TẢ:\nNgười dùng có mã nhận dạng {HARDWARE['uuid']} đã chấp nhận điều khoản & điều kiện sử dụng Vnstock lúc {now}\n---\n\nTHÔNG TIN THIẾT BỊ: {str(HARDWARE)}\n\nĐính kèm bản sao nội dung bạn đã đọc, hiểu rõ và đồng ý dưới đây:\n{self.terms_and_conditions}"
|
160
|
+
|
161
|
+
# Store the acceptance
|
162
|
+
with open(self.terms_file_path, "w", encoding="utf-8") as f:
|
163
|
+
f.write(signed_aggreement)
|
164
|
+
return True
|
165
|
+
|
166
|
+
def log_analytics_data(self):
|
167
|
+
"""
|
168
|
+
Sends analytics data to a webhook.
|
169
|
+
"""
|
170
|
+
HARDWARE = self.system_info()
|
171
|
+
EP = 'gAAAAABmOPNX4DJAsImlkzvtcyezBxr4UcK_HpCOgz-GOF9yBDP99tWNFYM_ZjeC22kNqmX3urZa467BC1D2fPLJrUkp6rQizYEMK4m196ZlOzUhwCbfjdvURXesL3LC7DofOgwWjNyltPQ8AnPyB4YUMnnAwnFooQ=='
|
172
|
+
TGE = self.cph.decrypt(self.target).decode('utf-8')
|
173
|
+
WH = f"{self.cph.decrypt(((self.RH+EP+self.RH)[30:-30]).encode()).decode('utf-8')}{TGE}"
|
174
|
+
|
175
|
+
data = {
|
176
|
+
"systems": HARDWARE,
|
177
|
+
"accepted_agreement": True,
|
178
|
+
"installed_packages": self.packages_installed(),
|
179
|
+
}
|
180
|
+
|
181
|
+
# save data to a json file in id folder
|
182
|
+
with open(self.env_config, "w", encoding="utf-8") as f:
|
183
|
+
f.write(json.dumps(data, indent=4))
|
184
|
+
|
185
|
+
try:
|
186
|
+
response = requests.post(WH, json=data)
|
187
|
+
except:
|
188
|
+
raise SystemExit("Không thể gửi dữ liệu phân tích. Vui lòng kiểm tra kết nối mạng và thử lại sau.")
|
189
|
+
|
190
|
+
def check_terms_accepted(self):
|
191
|
+
"""
|
192
|
+
Checks if terms and conditions are accepted.
|
193
|
+
"""
|
194
|
+
if not self.env_config.exists() or not self.terms_file_path.exists():
|
195
|
+
# If not, ask for acceptance
|
196
|
+
accepted = self.show_terms_and_conditions()
|
197
|
+
if not accepted:
|
198
|
+
raise SystemExit("Điều khoản và điều kiện không được chấp nhận. Không thể tiếp tục.")
|
199
|
+
else:
|
200
|
+
self.log_analytics_data()
|
201
|
+
|
202
|
+
def packages_installed(self):
|
203
|
+
"""
|
204
|
+
Checks installed packages and returns a dictionary.
|
205
|
+
"""
|
206
|
+
# Define package mapping
|
207
|
+
package_mapping = {
|
208
|
+
"vnstock_family": [
|
209
|
+
"vnstock",
|
210
|
+
"vnstock3",
|
211
|
+
"vnstock_ezchart",
|
212
|
+
"vnstock_data_pro"
|
213
|
+
"vnstock_market_data_pipeline",
|
214
|
+
"vnstock_ta",
|
215
|
+
"vnii",
|
216
|
+
"vnai",
|
217
|
+
],
|
218
|
+
"analytics": [
|
219
|
+
"openbb",
|
220
|
+
"pandas_ta"
|
221
|
+
],
|
222
|
+
"static_charts": [
|
223
|
+
"matplotlib",
|
224
|
+
"seaborn",
|
225
|
+
"altair"
|
226
|
+
],
|
227
|
+
"dashboard": [
|
228
|
+
"streamlit",
|
229
|
+
"voila",
|
230
|
+
"panel",
|
231
|
+
"shiny",
|
232
|
+
"dash",
|
233
|
+
],
|
234
|
+
"interactive_charts": [
|
235
|
+
"mplfinance",
|
236
|
+
"plotly",
|
237
|
+
"plotline",
|
238
|
+
"bokeh",
|
239
|
+
"pyecharts",
|
240
|
+
"highcharts-core",
|
241
|
+
"highcharts-stock",
|
242
|
+
"mplchart",
|
243
|
+
],
|
244
|
+
"datafeed": [
|
245
|
+
"yfinance",
|
246
|
+
"alpha_vantage",
|
247
|
+
"pandas-datareader",
|
248
|
+
"investpy",
|
249
|
+
],
|
250
|
+
"official_api": [
|
251
|
+
"ssi-fc-data",
|
252
|
+
"ssi-fctrading"
|
253
|
+
],
|
254
|
+
"risk_return": [
|
255
|
+
"pyfolio",
|
256
|
+
"empyrical",
|
257
|
+
"quantstats",
|
258
|
+
"financetoolkit",
|
259
|
+
],
|
260
|
+
"machine_learning": [
|
261
|
+
"scipy",
|
262
|
+
"sklearn",
|
263
|
+
"statsmodels",
|
264
|
+
"pytorch",
|
265
|
+
"tensorflow",
|
266
|
+
"keras",
|
267
|
+
"xgboost"
|
268
|
+
],
|
269
|
+
"indicators": [
|
270
|
+
"stochastic",
|
271
|
+
"talib",
|
272
|
+
"tqdm",
|
273
|
+
"finta",
|
274
|
+
"financetoolkit",
|
275
|
+
"tulipindicators"
|
276
|
+
],
|
277
|
+
"backtesting": [
|
278
|
+
"vectorbt",
|
279
|
+
"backtesting",
|
280
|
+
"bt",
|
281
|
+
"zipline",
|
282
|
+
"pyalgotrade",
|
283
|
+
"backtrader",
|
284
|
+
"pybacktest",
|
285
|
+
"fastquant",
|
286
|
+
"lean",
|
287
|
+
"ta",
|
288
|
+
"finmarketpy",
|
289
|
+
"qstrader",
|
290
|
+
],
|
291
|
+
"server": [
|
292
|
+
"fastapi",
|
293
|
+
"flask",
|
294
|
+
"uvicorn",
|
295
|
+
"gunicorn"
|
296
|
+
],
|
297
|
+
"framework": [
|
298
|
+
"lightgbm",
|
299
|
+
"catboost",
|
300
|
+
"django",
|
301
|
+
]
|
302
|
+
}
|
303
|
+
|
304
|
+
installed_packages = {}
|
305
|
+
|
306
|
+
for category, packages in package_mapping.items():
|
307
|
+
installed_packages[category] = []
|
308
|
+
for pkg in packages:
|
309
|
+
try:
|
310
|
+
version = importlib.metadata.version(pkg)
|
311
|
+
installed_packages[category].append((pkg, version))
|
312
|
+
except importlib.metadata.PackageNotFoundError:
|
313
|
+
pass
|
314
|
+
|
315
|
+
return installed_packages
|
316
|
+
|
317
|
+
def tc_init():
|
318
|
+
vnstock_initializer = VnstockInitializer(TG)
|
319
|
+
vnstock_initializer.check_terms_accepted()
|
@@ -1,20 +1,19 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: vnai
|
3
|
-
Version: 0.1.
|
4
|
-
Summary: :))
|
5
|
-
Author: Vnstock HQ
|
6
|
-
Author-email: support@vnstock.site
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
8
|
-
Classifier: Programming Language :: Python :: 3.10
|
9
|
-
Classifier: Programming Language :: Python :: 3.11
|
10
|
-
Classifier: Programming Language :: Python :: 3.12
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
12
|
-
Classifier: Operating System :: OS Independent
|
13
|
-
Requires-Python: >=3.10
|
14
|
-
Requires-Dist: requests
|
15
|
-
Requires-Dist: cryptography
|
16
|
-
Requires-Dist: psutil
|
17
|
-
Provides-Extra: dev
|
18
|
-
Requires-Dist: pytest
|
19
|
-
Requires-Dist: pytest-cov
|
20
|
-
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: vnai
|
3
|
+
Version: 0.1.4
|
4
|
+
Summary: :))
|
5
|
+
Author: Vnstock HQ
|
6
|
+
Author-email: support@vnstock.site
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
12
|
+
Classifier: Operating System :: OS Independent
|
13
|
+
Requires-Python: >=3.10
|
14
|
+
Requires-Dist: requests
|
15
|
+
Requires-Dist: cryptography
|
16
|
+
Requires-Dist: psutil
|
17
|
+
Provides-Extra: dev
|
18
|
+
Requires-Dist: pytest; extra == "dev"
|
19
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
@@ -0,0 +1,5 @@
|
|
1
|
+
vnai/__init__.py,sha256=k6Qn1-1DeiTMHs0TZk4tLwLzAb35qxcjhjg4fJQ046A,12245
|
2
|
+
vnai-0.1.4.dist-info/METADATA,sha256=tosZBcT5xYtgGkkKCyPf77H9LsqA0ja04vg-zByIcrQ,631
|
3
|
+
vnai-0.1.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
4
|
+
vnai-0.1.4.dist-info/top_level.txt,sha256=4zI0qZHePCwvgSqXl4420sBcd0VzZn4MEcRsAIFae3k,5
|
5
|
+
vnai-0.1.4.dist-info/RECORD,,
|
vnai-0.1.2.dist-info/RECORD
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
vnai/__init__.py,sha256=8D24Bh1a-BSiYq7lZoYtd_HdEp86GA-zNQrcqwl-rNY,11783
|
2
|
-
vnai-0.1.2.dist-info/METADATA,sha256=vjho6bosRgukpKGYAI8jXBLhWUk5hvWURHIU0DjRx08,615
|
3
|
-
vnai-0.1.2.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
4
|
-
vnai-0.1.2.dist-info/top_level.txt,sha256=4zI0qZHePCwvgSqXl4420sBcd0VzZn4MEcRsAIFae3k,5
|
5
|
-
vnai-0.1.2.dist-info/RECORD,,
|
File without changes
|