gjdatac-api 0.0.3__tar.gz → 0.0.4__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.3 → gjdatac_api-0.0.4}/PKG-INFO +1 -1
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/gjdatac_api/data_api_class.py +6 -4
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/gjdatac_api/dolphin_db_info.py +1 -53
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/gjdatac_api.egg-info/PKG-INFO +1 -1
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/setup.py +1 -1
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/gjdatac_api/__init__.py +0 -0
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/gjdatac_api/dict_data.py +0 -0
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/gjdatac_api.egg-info/SOURCES.txt +0 -0
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/gjdatac_api.egg-info/dependency_links.txt +0 -0
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/gjdatac_api.egg-info/requires.txt +0 -0
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/gjdatac_api.egg-info/top_level.txt +0 -0
- {gjdatac_api-0.0.3 → gjdatac_api-0.0.4}/setup.cfg +0 -0
|
@@ -28,10 +28,12 @@ class GJDataC:
|
|
|
28
28
|
try:
|
|
29
29
|
self.db_session = ddb.session()
|
|
30
30
|
self.db_session.connect(self.host, self.port, self.user_id, self.password)
|
|
31
|
-
self.db_session.close()
|
|
32
31
|
except Exception as e:
|
|
33
32
|
raise Exception("please check your database connection information")
|
|
34
33
|
|
|
34
|
+
''' 关闭数据库连接 '''
|
|
35
|
+
self.db_session.close()
|
|
36
|
+
|
|
35
37
|
''' get_price 接口相关属性 '''
|
|
36
38
|
self.get_price_data = None # 用于存放get_price接口数据
|
|
37
39
|
|
|
@@ -53,8 +55,8 @@ class GJDataC:
|
|
|
53
55
|
''' get_activate_contract 接口相关属性 '''
|
|
54
56
|
self.get_active_contract_data = None # 用于存放get_activate_contract接口数据
|
|
55
57
|
|
|
56
|
-
@staticmethod
|
|
57
|
-
def connect_db(table_name, db_path):
|
|
58
|
+
# @staticmethod
|
|
59
|
+
def connect_db(self, table_name, db_path):
|
|
58
60
|
"""
|
|
59
61
|
此方法用于根据不同的数据表及数据库获取数据,只返回Table对象,对应的数据处理在对应的数据接口处理
|
|
60
62
|
:param table_name: 数据表路径
|
|
@@ -64,7 +66,7 @@ class GJDataC:
|
|
|
64
66
|
|
|
65
67
|
# 连接数据库
|
|
66
68
|
db_session = ddb.session()
|
|
67
|
-
db_session.connect(
|
|
69
|
+
db_session.connect(self.host, self.port, self.user_id, self.password)
|
|
68
70
|
|
|
69
71
|
# 从数据库中获取数据
|
|
70
72
|
data = db_session.loadTable(tableName=table_name, dbPath=db_path)
|
|
@@ -1,52 +1,5 @@
|
|
|
1
1
|
# 此文件用于存放dolphinDB的相关信息,包括登录信息、数据库和表信息等。
|
|
2
2
|
|
|
3
|
-
""" 本地dolphindb数据库相关信息 """
|
|
4
|
-
|
|
5
|
-
# 登录信息
|
|
6
|
-
# HOST = "localhost" # 主机名或IP地址
|
|
7
|
-
HOST = "10.100.96.125" # 主机名或IP地址
|
|
8
|
-
PORT = 8848 # 端口号
|
|
9
|
-
USER_ID = "admin" # 用户名
|
|
10
|
-
PASSWORD = "123456" # 密码
|
|
11
|
-
|
|
12
|
-
# 数据库、表信息
|
|
13
|
-
''' get_price 行情数据接口所在的数据库和表 '''
|
|
14
|
-
get_price_db_path = "dfs://firstdb" # 数据库路径
|
|
15
|
-
get_price_db_table_name = "get_price_tb" # 表名
|
|
16
|
-
|
|
17
|
-
''' get_instruments 合约基础信息接口所在的数据库和表 '''
|
|
18
|
-
get_instruments_db_path = "dfs://firstdb" # 数据库路径
|
|
19
|
-
get_instruments_db_table_name = "get_instruments_tb" # 表名
|
|
20
|
-
|
|
21
|
-
''' get_trading_dates 交易日历接口所在的数据库和表 '''
|
|
22
|
-
get_trading_dates_db_path = "dfs://firstdb" # 数据库路径
|
|
23
|
-
get_trading_dates_db_table_name = "get_trading_dates_tb" # 表名
|
|
24
|
-
|
|
25
|
-
''' get_margin_ratio 期货保证金接口所在的数据库和表 '''
|
|
26
|
-
get_margin_ratio_db_path = "dfs://firstdb" # 数据库路径
|
|
27
|
-
get_margin_ratio_db_table_name = "get_margin_ratio_tb" # 表名
|
|
28
|
-
|
|
29
|
-
''' get_fee 期货交割手续费接口所在的数据库和表 '''
|
|
30
|
-
get_fee_db_path = "dfs://firstdb" # 数据库路径
|
|
31
|
-
get_fee_db_table_name = "get_fee_tb" # 表名
|
|
32
|
-
|
|
33
|
-
''' get_limit_position 期货限仓数据接口所在的数据库和表 '''
|
|
34
|
-
get_limit_position_db_path = "dfs://firstdb" # 数据库路径
|
|
35
|
-
get_limit_position_db_table_name = "get_limit_position_tb" # 表名
|
|
36
|
-
|
|
37
|
-
''' get_active_contract 主力/次主力合约接口所在的数据库和表 '''
|
|
38
|
-
get_active_contract_db_path = "dfs://firstdb" # 数据库路径
|
|
39
|
-
get_active_contract_db_table_name = "get_active_contract_tb" # 表名
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
""" 公司dolphindb数据库相关信息 """
|
|
43
|
-
|
|
44
|
-
# 登录信息
|
|
45
|
-
COMPANY_HOST = "10.74.56.101" # 主机名或IP地址
|
|
46
|
-
COMPANY_PORT = 8902 # 端口号
|
|
47
|
-
COMPANY_USER_ID = "sys_asset_zdgl" # 用户名
|
|
48
|
-
COMPANY_PASSWORD = "zdgl@1qaz2wsx" # 密码
|
|
49
|
-
|
|
50
3
|
""" 行情数据所在数据库和表 """
|
|
51
4
|
|
|
52
5
|
''' 期货 '''
|
|
@@ -68,7 +21,7 @@ history_option_tick_db_path = "dfs://tick" # 数据库路径
|
|
|
68
21
|
history_option_tick_db_table_name = "ctp_option_tick" # 表名
|
|
69
22
|
|
|
70
23
|
# 历史期权行情数据 分钟k线
|
|
71
|
-
history_option_min_db_path = "dfs://minutek"
|
|
24
|
+
history_option_min_db_path = "dfs://minutek" # 数据库路径
|
|
72
25
|
history_option_min_db_table_name = "ctp_option_mink" # 表名
|
|
73
26
|
|
|
74
27
|
# 历史期权行情数据 5分钟k线
|
|
@@ -101,8 +54,3 @@ option_contract_db_table_name = "t_optinstrument" # 表名
|
|
|
101
54
|
# 交易日历
|
|
102
55
|
trading_dates_db_path = "dfs://basicinfo" # 数据库路径
|
|
103
56
|
trading_dates_db_table_name = "b_calendar" # 表名
|
|
104
|
-
|
|
105
|
-
{
|
|
106
|
-
"name": "sfs",
|
|
107
|
-
"sfs": "sfs"
|
|
108
|
-
}
|
|
@@ -5,7 +5,7 @@ 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.4', # 版本号
|
|
9
9
|
description='主动管理项目第一版(部分接口)', # 包的简要描述
|
|
10
10
|
long_description=long_description, # 包的详细描述
|
|
11
11
|
long_description_content_type='text/markdown', # 描述文件的类型
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|