gjdatac-api 0.2.4__tar.gz → 0.2.5__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 gjdatac-api might be problematic. Click here for more details.
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/PKG-INFO +1 -1
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/gjdatac_api/data_api_class.py +8 -16
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/gjdatac_api.egg-info/PKG-INFO +1 -1
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/setup.py +1 -1
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/gjdatac_api/__init__.py +0 -0
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/gjdatac_api/dict_data.py +0 -0
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/gjdatac_api/dolphindb_info.py +0 -0
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/gjdatac_api/instrument_class.py +0 -0
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/gjdatac_api.egg-info/SOURCES.txt +0 -0
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/gjdatac_api.egg-info/dependency_links.txt +0 -0
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/gjdatac_api.egg-info/requires.txt +0 -0
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/gjdatac_api.egg-info/top_level.txt +0 -0
- {gjdatac_api-0.2.4 → gjdatac_api-0.2.5}/setup.cfg +0 -0
|
@@ -2952,7 +2952,6 @@ class GJDataC:
|
|
|
2952
2952
|
# 转换日期格式
|
|
2953
2953
|
# query_time = self._get_history_bar_parse_datetime(datetime_str)
|
|
2954
2954
|
|
|
2955
|
-
# 1d ['v2505'] 2025.01.21 1
|
|
2956
2955
|
# 执行查询并筛选数据
|
|
2957
2956
|
result, bar_db_session = self._get_history_bar_execute_query(frequency, instrument_id, datetime_str,
|
|
2958
2957
|
bar_count)
|
|
@@ -3055,7 +3054,6 @@ class GJDataC:
|
|
|
3055
3054
|
|
|
3056
3055
|
# 获取表信息
|
|
3057
3056
|
table_info = self._get_history_bar_get_table_info(frequency, instrument_id)
|
|
3058
|
-
print(table_info)
|
|
3059
3057
|
|
|
3060
3058
|
# 获取数据
|
|
3061
3059
|
table_data, bar_db_session = self.connect_db(table_info[0], table_info[1])
|
|
@@ -3112,22 +3110,16 @@ class GJDataC:
|
|
|
3112
3110
|
# dolphin_date = self._get_history_bar_datetime_to_dolphin_time(datetime_str)
|
|
3113
3111
|
dolphin_date = datetime_str
|
|
3114
3112
|
|
|
3115
|
-
# 使用 DolphinDB 的 where 子句筛选数据(这里因为实际需求的原因需要对每个instrument_id进行筛选,所以需要使用 contextby)
|
|
3116
|
-
# 根据bar_count 分别对不同的instrument_id 进行筛选
|
|
3117
|
-
# 此处的逻辑是,筛选出每个instrument_id距离给定日期最近的前bar_count条数据
|
|
3118
|
-
|
|
3119
3113
|
if isinstance(instrument_id, str):
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
query_data = table_data.where(f"instrument_id='{instrument_id}'").where(f"trading_day = {dolphin_date}")
|
|
3114
|
+
query_data = (table_data.where(f"instrument_id='{instrument_id}'")
|
|
3115
|
+
.where(f"trading_day <= {dolphin_date}")
|
|
3116
|
+
.sort("trading_day", ascending=False)
|
|
3117
|
+
.limit(bar_count))
|
|
3125
3118
|
else:
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
query_data = table_data.where(f"instrument_id in {instrument_id}").where(f"trading_day = {dolphin_date}")
|
|
3119
|
+
query_data = (table_data.where(f"instrument_id in {instrument_id}")
|
|
3120
|
+
.where(f"trading_day <= {dolphin_date}")
|
|
3121
|
+
.sort("trading_day", ascending=False)
|
|
3122
|
+
.limit(bar_count))
|
|
3131
3123
|
|
|
3132
3124
|
# 根据日期对数据再次进行筛选,最大程度减轻数据库压力
|
|
3133
3125
|
query_data = query_data.where(f"trade_time <= {dolphin_date}")
|
|
@@ -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.2.
|
|
8
|
+
version='0.2.5', # 版本号
|
|
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
|
|
File without changes
|
|
File without changes
|