gjdatac-api 0.0.2__tar.gz → 0.0.3__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.
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/PKG-INFO +1 -1
- gjdatac_api-0.0.3/gjdatac_api/__init__.py +4 -0
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/gjdatac_api/data_api_class.py +12 -17
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/gjdatac_api.egg-info/PKG-INFO +1 -1
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/gjdatac_api.egg-info/SOURCES.txt +0 -1
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/setup.py +2 -2
- gjdatac_api-0.0.2/gjdatac_api/__init__.py +0 -9
- gjdatac_api-0.0.2/gjdatac_api/initializer.py +0 -10
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/gjdatac_api/dict_data.py +0 -0
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/gjdatac_api/dolphin_db_info.py +0 -0
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/gjdatac_api.egg-info/dependency_links.txt +0 -0
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/gjdatac_api.egg-info/requires.txt +0 -0
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/gjdatac_api.egg-info/top_level.txt +0 -0
- {gjdatac_api-0.0.2 → gjdatac_api-0.0.3}/setup.cfg +0 -0
|
@@ -12,20 +12,25 @@ from .dolphin_db_info import *
|
|
|
12
12
|
|
|
13
13
|
class GJDataC:
|
|
14
14
|
|
|
15
|
-
def __init__(self):
|
|
15
|
+
def __init__(self, host, port, user_id, password):
|
|
16
16
|
"""
|
|
17
17
|
用于定义一些不同接口所需的变量以及一些初始化操作
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
+
''' 初始化校验 '''
|
|
20
21
|
# 数据库参数
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
self.host = host
|
|
23
|
+
self.port = port
|
|
24
|
+
self.user_id = user_id
|
|
25
|
+
self.password = password
|
|
25
26
|
|
|
26
27
|
# 连接数据库
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
try:
|
|
29
|
+
self.db_session = ddb.session()
|
|
30
|
+
self.db_session.connect(self.host, self.port, self.user_id, self.password)
|
|
31
|
+
self.db_session.close()
|
|
32
|
+
except Exception as e:
|
|
33
|
+
raise Exception("please check your database connection information")
|
|
29
34
|
|
|
30
35
|
''' get_price 接口相关属性 '''
|
|
31
36
|
self.get_price_data = None # 用于存放get_price接口数据
|
|
@@ -312,16 +317,6 @@ class GJDataC:
|
|
|
312
317
|
self.general_validate_params_required(order_book_ids, "order_book_ids") # 校验必填参数
|
|
313
318
|
self.general_validate_field_str_or_list(order_book_ids, "order_book_ids") # 校验参数类型
|
|
314
319
|
|
|
315
|
-
# def get_price_filter_by_order_book_ids(self, order_book_ids):
|
|
316
|
-
# """
|
|
317
|
-
# 根据order_book_ids筛选数据
|
|
318
|
-
# """
|
|
319
|
-
# if isinstance(order_book_ids, str):
|
|
320
|
-
# self.get_price_data = self.get_price_data[self.get_price_data["order_book_ids"] == order_book_ids]
|
|
321
|
-
# elif isinstance(order_book_ids, list):
|
|
322
|
-
# self.get_price_data = self.get_price_data[self.get_price_data["order_book_ids"].isin(order_book_ids)]
|
|
323
|
-
# return self.get_price_data
|
|
324
|
-
|
|
325
320
|
def __get_price_validate_frequency(self, frequency):
|
|
326
321
|
"""
|
|
327
322
|
对frequency进行校验
|
|
@@ -5,12 +5,12 @@ with open('description_info.md', 'r', encoding='utf-8') as f:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name='gjdatac_api', # 你的包名
|
|
8
|
-
version='0.0.
|
|
8
|
+
version='0.0.3', # 版本号
|
|
9
9
|
description='主动管理项目第一版(部分接口)', # 包的简要描述
|
|
10
10
|
long_description=long_description, # 包的详细描述
|
|
11
11
|
long_description_content_type='text/markdown', # 描述文件的类型
|
|
12
12
|
include_package_data=True, # 包含包数据
|
|
13
|
-
package_data={'gjdatac_api': ['*.py', 'dict_data.py', 'dolphin_db_info.py'
|
|
13
|
+
package_data={'gjdatac_api': ['*.py', 'dict_data.py', 'dolphin_db_info.py']}, # 指定数据文件
|
|
14
14
|
author='yin', # 作者姓名
|
|
15
15
|
author_email='2018209921@qq.com', # 作者邮箱
|
|
16
16
|
packages=find_packages(), # 自动查找包目录
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import dolphindb as ddb
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def init(ip_address, port, user_id, password):
|
|
5
|
-
# 在这里实现 IP 地址和端口号的验证逻辑
|
|
6
|
-
try:
|
|
7
|
-
db_session = ddb.session()
|
|
8
|
-
db_session.connect(ip_address, port, user_id, password)
|
|
9
|
-
except Exception as e:
|
|
10
|
-
raise Exception("please check your ip_address, port, user_id, password")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|