DYPMS 0.2__tar.gz → 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.
- {dypms-0.2/src/DYPMS.egg-info → dypms-0.4}/PKG-INFO +1 -1
- {dypms-0.2 → dypms-0.4}/pyproject.toml +1 -1
- {dypms-0.2 → dypms-0.4}/src/DYPMS/api/get_simulate_portfolio_list.py +2 -2
- {dypms-0.2 → dypms-0.4}/src/DYPMS/api/get_simulate_portfolio_position.py +11 -2
- {dypms-0.2 → dypms-0.4/src/DYPMS.egg-info}/PKG-INFO +1 -1
- {dypms-0.2 → dypms-0.4}/LICENSE +0 -0
- {dypms-0.2 → dypms-0.4}/README.md +0 -0
- {dypms-0.2 → dypms-0.4}/setup.cfg +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS/__init__.py +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS/api/__init__.py +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS/api/get_simulate_portfolio_net.py +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS/api/get_simulate_portfolio_performance_indicators.py +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS/api/get_simulate_portfolio_position_hierarchy.py +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS/api/get_style_attr_trend.py +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS/api/heartbeat.py +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS/api/util.py +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS/client.py +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS/enums.py +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS.egg-info/SOURCES.txt +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS.egg-info/dependency_links.txt +0 -0
- {dypms-0.2 → dypms-0.4}/src/DYPMS.egg-info/top_level.txt +0 -0
|
@@ -10,8 +10,7 @@ field_mapping = {
|
|
|
10
10
|
'reportingBenchmark': 'benchmark', # 参考基准
|
|
11
11
|
'user': 'creator', # 用户作为创建人
|
|
12
12
|
'netValueStartDate': 'NAV_start_date', # 净值开始日期
|
|
13
|
-
'netValueDate': 'latest_NAV_date'
|
|
14
|
-
'navFrequency': 'NAV_update_frequency' # 净值更新频率
|
|
13
|
+
'netValueDate': 'latest_NAV_date' # 最新净值日期
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
|
|
@@ -36,6 +35,7 @@ def get_simulate_portfolio_list(client,
|
|
|
36
35
|
rows.append(row)
|
|
37
36
|
|
|
38
37
|
df = pd.DataFrame(rows)
|
|
38
|
+
df = df.sort_values(by='establishment_date', ascending=False)
|
|
39
39
|
return df
|
|
40
40
|
except Exception as e:
|
|
41
41
|
raise e
|
|
@@ -125,8 +125,17 @@ def get_simulate_portfolio_position(client,
|
|
|
125
125
|
simulate_portfolio_id: 模拟组合代码,必传
|
|
126
126
|
start_date: 开始日期
|
|
127
127
|
end_date: 结束日期
|
|
128
|
-
penetrate_style:
|
|
128
|
+
penetrate_style: 穿透方式,支持PenetrateType枚举或字符串如"NO_PENETRATE"
|
|
129
129
|
"""
|
|
130
|
+
if isinstance(penetrate_style, PenetrateType):
|
|
131
|
+
penetrate_style_value = penetrate_style.name
|
|
132
|
+
elif isinstance(penetrate_style, str):
|
|
133
|
+
if penetrate_style not in PenetrateType._member_names_:
|
|
134
|
+
raise ValueError("不支持的穿透方式")
|
|
135
|
+
penetrate_style_value = penetrate_style
|
|
136
|
+
else:
|
|
137
|
+
penetrate_style_value = PenetrateType.NO_PENETRATE.name
|
|
138
|
+
|
|
130
139
|
url = f"{client.base_url}/lib/simulate/portfolio/v1/position"
|
|
131
140
|
headers = client.get_headers()
|
|
132
141
|
|
|
@@ -134,7 +143,7 @@ def get_simulate_portfolio_position(client,
|
|
|
134
143
|
'accountCode': simulate_portfolio_id,
|
|
135
144
|
'startDate': start_date,
|
|
136
145
|
'endDate': end_date,
|
|
137
|
-
'penetrateWay':
|
|
146
|
+
'penetrateWay': penetrate_style_value,
|
|
138
147
|
}
|
|
139
148
|
|
|
140
149
|
# 移除None值
|
{dypms-0.2 → dypms-0.4}/LICENSE
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|