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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DYPMS
3
- Version: 0.2
3
+ Version: 0.4
4
4
  Summary: 通联数据PMS系统数据SDK
5
5
  Author-email: songjiangduo <jiangduo.song@datayes.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "DYPMS"
7
- version = "0.2"
7
+ version = "0.4"
8
8
  authors = [
9
9
  { name = "songjiangduo", email = "jiangduo.song@datayes.com" }
10
10
  ]
@@ -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: 穿透方式,枚举PenetrateType
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': penetrate_style.name if penetrate_style else PenetrateType.NO_PENETRATE,
146
+ 'penetrateWay': penetrate_style_value,
138
147
  }
139
148
 
140
149
  # 移除None值
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DYPMS
3
- Version: 0.2
3
+ Version: 0.4
4
4
  Summary: 通联数据PMS系统数据SDK
5
5
  Author-email: songjiangduo <jiangduo.song@datayes.com>
6
6
  License-Expression: MIT
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