PyQuantimClient 2.0.15__tar.gz → 2.0.17__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.
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/PKG-INFO +1 -1
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/PyQuantimClient.egg-info/PKG-INFO +1 -1
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/setup.py +1 -1
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/risk.py +41 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/PyQuantimClient.egg-info/SOURCES.txt +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/PyQuantimClient.egg-info/dependency_links.txt +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/PyQuantimClient.egg-info/top_level.txt +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/README.md +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/setup.cfg +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/__init__.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/alm.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/api.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/benchmarks.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/bi.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/credit.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/data.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/energy.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/performance.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/portfolios.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/preprocess_co.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/returns.py +0 -0
- {pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/src/utils.py +0 -0
|
@@ -4,7 +4,7 @@ setup(
|
|
|
4
4
|
name='PyQuantimClient',
|
|
5
5
|
packages=['PyQuantimClient'],
|
|
6
6
|
package_dir={'PyQuantimClient': 'src'},
|
|
7
|
-
version='2.0.
|
|
7
|
+
version='2.0.17',
|
|
8
8
|
description='Python client to access quantIM services',
|
|
9
9
|
author='Daniel Velasquez',
|
|
10
10
|
author_email='daniel.velasquez@sura-im.com',
|
|
@@ -73,6 +73,35 @@ class risk_data(quantim):
|
|
|
73
73
|
portfolio, port_dur, port_per_msg, limits = pd.DataFrame(resp['portfolio']), resp['port_dur'], resp['port_per_msg'], resp['limits']
|
|
74
74
|
limits_summ = pd.DataFrame(limits['summ'])
|
|
75
75
|
return portfolio, port_dur, port_per_msg, limits_summ
|
|
76
|
+
|
|
77
|
+
def pretrade(self, portfolioName, subgroup=False, new_oper=False, cash=False, return_detail=False, res_url=False):
|
|
78
|
+
'''
|
|
79
|
+
Run limits lambda
|
|
80
|
+
|
|
81
|
+
'''
|
|
82
|
+
if new_oper is not False:
|
|
83
|
+
cols=['type', 'secDesc1', 'isin', 'assetId', 'issuerId', 'issuerLongName', 'ccy', 'duration', 'avgRating', 'ratingType', 'SIM_SECTOR', 'linkedEntity', 'quantity', 'mktValue', 'maturity']
|
|
84
|
+
if not set(cols).issubset(new_oper.columns):
|
|
85
|
+
raise ValueError(f"Las nuevas operaciones deben contener la siguiente informacion: {cols}. Por favor revisar")
|
|
86
|
+
else:
|
|
87
|
+
new_oper = new_oper[cols]
|
|
88
|
+
if not set(new_oper["type"].unique()).issubset({"BUY", "SELL"}):
|
|
89
|
+
raise ValueError("La columna type unicamente recibe los valores 'BUY' o 'SELL'.")
|
|
90
|
+
sell=new_oper[new_oper["type"]=="SELL"]
|
|
91
|
+
buy=new_oper[new_oper["type"]=="BUY"]
|
|
92
|
+
if buy.isna().any().any():
|
|
93
|
+
raise ValueError("Para las compras todas las columnas deben contener información. Por favor completar los datos.")
|
|
94
|
+
if sell[['isin' ,'quantity', 'mktValue']].isna().any().any():
|
|
95
|
+
raise ValueError("Para las ventas las columnas isin, quantity y mktValue deben contener información. Por favor completar los datos.")
|
|
96
|
+
new_oper=new_oper.to_dict(orient="records")
|
|
97
|
+
print("Ejecutando límites...")
|
|
98
|
+
data = {'portfolioName':portfolioName, 'subgroup':subgroup, 'cash':cash, 'new_oper':new_oper, 'return_detail':return_detail, 'res_url':res_url}
|
|
99
|
+
resp = self.api_call('limits', method="post", data=data, verify=False)
|
|
100
|
+
limites_resumen = pd.DataFrame(resp['summ'])
|
|
101
|
+
if return_detail:
|
|
102
|
+
limites_detalle = pd.DataFrame(resp['detail'])
|
|
103
|
+
return limites_resumen, limites_detalle
|
|
104
|
+
return limites_resumen
|
|
76
105
|
|
|
77
106
|
def get_cashflows(self, client_id=None, port_type=None):
|
|
78
107
|
'''
|
|
@@ -130,6 +159,18 @@ class risk_data(quantim):
|
|
|
130
159
|
resp = self.upload_with_presigned_url(file_path, "condor-sura", f"inputs/risk/static/{filename}")
|
|
131
160
|
return resp
|
|
132
161
|
|
|
162
|
+
def load_vu_pas(self, file_path):
|
|
163
|
+
'''
|
|
164
|
+
Load PAs prices to s3.
|
|
165
|
+
'''
|
|
166
|
+
# Validate filename:
|
|
167
|
+
filename = file_path.split('/')[-1]
|
|
168
|
+
if filename != 'BD_PAS.csv':
|
|
169
|
+
raise ValueError('You can only load a file named BD_PAS.csv. Please check file name and extension.')
|
|
170
|
+
|
|
171
|
+
resp = self.upload_with_presigned_url(file_path, "condor-sura", f"inputs/portfolios/nav/CO/{filename}")
|
|
172
|
+
return resp
|
|
173
|
+
|
|
133
174
|
def get_irl(self, ref_date=None, return_cfs=False):
|
|
134
175
|
'''
|
|
135
176
|
Get cashflows
|
|
File without changes
|
{pyquantimclient-2.0.15 → pyquantimclient-2.0.17}/PyQuantimClient.egg-info/dependency_links.txt
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
|
|
File without changes
|