DYAMS 0.5__tar.gz → 0.7__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.
- {dyams-0.5/src/DYAMS.egg-info → dyams-0.7}/PKG-INFO +1 -1
- {dyams-0.5 → dyams-0.7}/pyproject.toml +1 -1
- dyams-0.7/src/DYAMS/__init__.py +27 -0
- dyams-0.5/src/DYAMS/api/get_asset_allocation.py → dyams-0.7/src/DYAMS/api/get_post_investment_product_asset_allocation.py +11 -11
- dyams-0.5/src/DYAMS/api/get_portfolio_holdings.py → dyams-0.7/src/DYAMS/api/get_post_investment_product_holdings.py +10 -10
- dyams-0.5/src/DYAMS/api/get_performance_indicators.py → dyams-0.7/src/DYAMS/api/get_post_investment_product_performance_indicators.py +2 -2
- dyams-0.5/src/DYAMS/api/private_net.py → dyams-0.7/src/DYAMS/api/get_private_asset_net.py +5 -5
- {dyams-0.5 → dyams-0.7}/src/DYAMS/client.py +15 -17
- {dyams-0.5 → dyams-0.7/src/DYAMS.egg-info}/PKG-INFO +1 -1
- {dyams-0.5 → dyams-0.7}/src/DYAMS.egg-info/SOURCES.txt +4 -4
- dyams-0.5/src/DYAMS/__init__.py +0 -3
- {dyams-0.5 → dyams-0.7}/LICENSE +0 -0
- {dyams-0.5 → dyams-0.7}/README.md +0 -0
- {dyams-0.5 → dyams-0.7}/setup.cfg +0 -0
- {dyams-0.5 → dyams-0.7}/src/DYAMS/api/__init__.py +0 -0
- {dyams-0.5 → dyams-0.7}/src/DYAMS/api/get_post_investment_product_list.py +0 -0
- {dyams-0.5 → dyams-0.7}/src/DYAMS/api/get_post_investment_product_net.py +0 -0
- {dyams-0.5 → dyams-0.7}/src/DYAMS/api/heartbeat.py +0 -0
- {dyams-0.5 → dyams-0.7}/src/DYAMS/api/util.py +0 -0
- {dyams-0.5 → dyams-0.7}/src/DYAMS/enums.py +0 -0
- {dyams-0.5 → dyams-0.7}/src/DYAMS.egg-info/dependency_links.txt +0 -0
- {dyams-0.5 → dyams-0.7}/src/DYAMS.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from .client import Client
|
|
2
|
+
|
|
3
|
+
__all__ = ['Client']
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def get_post_investment_product_list(*args, **kwargs):
|
|
7
|
+
return Client.get_instance().get_post_investment_product_list(*args, **kwargs)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_post_investment_product_holdings(*args, **kwargs):
|
|
11
|
+
return Client.get_instance().get_post_investment_product_holdings(*args, **kwargs)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_post_investment_product_performance_indicators(*args, **kwargs):
|
|
15
|
+
return Client.get_instance().get_post_investment_product_performance_indicators(*args, **kwargs)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def get_post_investment_product_net(*args, **kwargs):
|
|
19
|
+
return Client.get_instance().get_post_investment_product_net(*args, **kwargs)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def get_post_investment_product_asset_allocation(*args, **kwargs):
|
|
23
|
+
return Client.get_instance().get_post_investment_product_asset_allocation(*args, **kwargs)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def get_private_asset_net(*args, **kwargs):
|
|
27
|
+
return Client.get_instance().get_private_asset_net(*args, **kwargs)
|
|
@@ -11,16 +11,16 @@ field_mapping = {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
def get_post_investment_product_asset_allocation(client,
|
|
15
|
+
post_investment_product_id,
|
|
16
|
+
start_date=None,
|
|
17
|
+
end_date=None,
|
|
18
|
+
date=None,
|
|
19
|
+
asset_class="交易属性",
|
|
20
|
+
penetrate_type=PenetrateType.NO_PENETRATE,
|
|
21
|
+
level=1,
|
|
22
|
+
weight_types=WeightType.TOTAL_FILTERED,
|
|
23
|
+
asset_sceening=[]):
|
|
24
24
|
|
|
25
25
|
if date:
|
|
26
26
|
start_date = date
|
|
@@ -33,7 +33,7 @@ def get_asset_allocation(client,
|
|
|
33
33
|
'accountCode': post_investment_product_id,
|
|
34
34
|
'startDate': start_date,
|
|
35
35
|
'endDate': end_date,
|
|
36
|
-
'penetrateWay':
|
|
36
|
+
'penetrateWay': penetrate_type.name if penetrate_type else PenetrateType.NO_PENETRATE,
|
|
37
37
|
'level': level,
|
|
38
38
|
'assetCategoryName': asset_class,
|
|
39
39
|
'ratioAssetType': weight_types.name if weight_types else WeightType.TOTAL_FILTERED,
|
|
@@ -124,15 +124,15 @@ field_mapping = {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
def
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
def get_post_investment_product_holdings(client,
|
|
128
|
+
post_investment_product_id,
|
|
129
|
+
start_date=None,
|
|
130
|
+
end_date=None,
|
|
131
|
+
date=None,
|
|
132
|
+
asset_class="交易属性",
|
|
133
|
+
penetrate_type=PenetrateType.NO_PENETRATE,
|
|
134
|
+
level=1,
|
|
135
|
+
fields=[]):
|
|
136
136
|
|
|
137
137
|
if date:
|
|
138
138
|
start_date = date
|
|
@@ -145,7 +145,7 @@ def get_portfolio_holdings(client,
|
|
|
145
145
|
'accountCode': post_investment_product_id,
|
|
146
146
|
'startDate': start_date,
|
|
147
147
|
'endDate': end_date,
|
|
148
|
-
'penetrateWay':
|
|
148
|
+
'penetrateWay': penetrate_type.name if penetrate_type else PenetrateType.NO_PENETRATE,
|
|
149
149
|
'level': level,
|
|
150
150
|
'assetCategoryName': asset_class
|
|
151
151
|
}
|
|
@@ -25,8 +25,8 @@ field_mapping = {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def
|
|
29
|
-
|
|
28
|
+
def get_post_investment_product_performance_indicators(client,
|
|
29
|
+
post_investment_product_id):
|
|
30
30
|
|
|
31
31
|
url = f"{client.base_url}/lib/portfolio/v1/perf"
|
|
32
32
|
headers = client.get_headers()
|
|
@@ -10,11 +10,11 @@ field_mapping = {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
def
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
def get_private_asset_net(client,
|
|
14
|
+
product_name=None,
|
|
15
|
+
product_code=None,
|
|
16
|
+
start_date=None,
|
|
17
|
+
end_date=None):
|
|
18
18
|
|
|
19
19
|
url = f"{client.base_url}/lib/asset/v1/nav"
|
|
20
20
|
headers = client.get_headers()
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
from .api.heartbeat import heartbeat
|
|
2
2
|
from .api.get_post_investment_product_list import get_post_investment_product_list
|
|
3
|
-
from .api.
|
|
4
|
-
from .api.
|
|
3
|
+
from .api.get_post_investment_product_holdings import get_post_investment_product_holdings
|
|
4
|
+
from .api.get_post_investment_product_performance_indicators import get_post_investment_product_performance_indicators
|
|
5
5
|
from .api.get_post_investment_product_net import get_post_investment_product_net
|
|
6
|
-
from .api.
|
|
7
|
-
from .api.
|
|
6
|
+
from .api.get_post_investment_product_asset_allocation import get_post_investment_product_asset_allocation
|
|
7
|
+
from .api.get_private_asset_net import get_private_asset_net
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class Client:
|
|
11
11
|
|
|
12
12
|
_instance = None
|
|
13
13
|
|
|
14
|
-
def __new__(cls, *args, **kwargs):
|
|
15
|
-
if cls._instance is None:
|
|
16
|
-
cls._instance = super(Client, cls).__new__(cls)
|
|
17
|
-
cls._instance._initialized = False
|
|
18
|
-
return cls._instance
|
|
19
|
-
|
|
20
14
|
def __init__(self, token='', env='prd'):
|
|
21
|
-
if self._initialized:
|
|
22
|
-
return
|
|
23
15
|
self.token = token
|
|
24
16
|
if env == 'prd':
|
|
25
17
|
self.base_url = "https://gw.datayes.com/aladdin_mof"
|
|
@@ -29,8 +21,14 @@ class Client:
|
|
|
29
21
|
self.base_url = "https://gw.datayes-stg.com/mom_aladdin_stg"
|
|
30
22
|
else:
|
|
31
23
|
raise ValueError("error env")
|
|
32
|
-
self._initialized = True
|
|
33
24
|
heartbeat(self)
|
|
25
|
+
Client._instance = self
|
|
26
|
+
|
|
27
|
+
@staticmethod
|
|
28
|
+
def get_instance():
|
|
29
|
+
if Client._instance is None:
|
|
30
|
+
raise RuntimeError("Client未初始化,请先实例化Client")
|
|
31
|
+
return Client._instance
|
|
34
32
|
|
|
35
33
|
def get_headers(self):
|
|
36
34
|
return {
|
|
@@ -40,8 +38,8 @@ class Client:
|
|
|
40
38
|
|
|
41
39
|
|
|
42
40
|
Client.get_post_investment_product_list = get_post_investment_product_list
|
|
43
|
-
Client.
|
|
44
|
-
Client.
|
|
41
|
+
Client.get_post_investment_product_holdings = get_post_investment_product_holdings
|
|
42
|
+
Client.get_post_investment_product_performance_indicators = get_post_investment_product_performance_indicators
|
|
45
43
|
Client.get_post_investment_product_net = get_post_investment_product_net
|
|
46
|
-
Client.
|
|
47
|
-
Client.
|
|
44
|
+
Client.get_post_investment_product_asset_allocation = get_post_investment_product_asset_allocation
|
|
45
|
+
Client.get_private_asset_net = get_private_asset_net
|
|
@@ -9,11 +9,11 @@ src/DYAMS.egg-info/SOURCES.txt
|
|
|
9
9
|
src/DYAMS.egg-info/dependency_links.txt
|
|
10
10
|
src/DYAMS.egg-info/top_level.txt
|
|
11
11
|
src/DYAMS/api/__init__.py
|
|
12
|
-
src/DYAMS/api/
|
|
13
|
-
src/DYAMS/api/
|
|
14
|
-
src/DYAMS/api/get_portfolio_holdings.py
|
|
12
|
+
src/DYAMS/api/get_post_investment_product_asset_allocation.py
|
|
13
|
+
src/DYAMS/api/get_post_investment_product_holdings.py
|
|
15
14
|
src/DYAMS/api/get_post_investment_product_list.py
|
|
16
15
|
src/DYAMS/api/get_post_investment_product_net.py
|
|
16
|
+
src/DYAMS/api/get_post_investment_product_performance_indicators.py
|
|
17
|
+
src/DYAMS/api/get_private_asset_net.py
|
|
17
18
|
src/DYAMS/api/heartbeat.py
|
|
18
|
-
src/DYAMS/api/private_net.py
|
|
19
19
|
src/DYAMS/api/util.py
|
dyams-0.5/src/DYAMS/__init__.py
DELETED
{dyams-0.5 → dyams-0.7}/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
|