PyQuantimClient 1.0.87__tar.gz → 1.0.91__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-1.0.87 → pyquantimclient-1.0.91}/PKG-INFO +1 -1
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/PyQuantimClient.egg-info/PKG-INFO +1 -1
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/setup.py +1 -1
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/src/portfolios.py +4 -2
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/src/risk.py +17 -16
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/PyQuantimClient.egg-info/SOURCES.txt +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/PyQuantimClient.egg-info/dependency_links.txt +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/PyQuantimClient.egg-info/top_level.txt +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/README.md +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/setup.cfg +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/src/__init__.py +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/src/api.py +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/src/benchmarks.py +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/src/bi.py +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/src/data.py +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/src/energy.py +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/src/performance.py +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/src/preprocess_co.py +0 -0
- {pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/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='1.0.
|
|
7
|
+
version='1.0.91',
|
|
8
8
|
description='Python client to access quantIM services',
|
|
9
9
|
author='Daniel Velasquez',
|
|
10
10
|
author_email='daniel.velasquez@sura-im.com',
|
|
@@ -68,16 +68,18 @@ class portfolios(quantim):
|
|
|
68
68
|
series_df = pd.concat([series_df, pd.DataFrame(resp['series'][k]).set_index('date')], axis=1)
|
|
69
69
|
return absolute_risk, relative_risk, real_rets, series_df
|
|
70
70
|
|
|
71
|
-
def series(self, country=None, funds=None, ref_date=None):
|
|
71
|
+
def series(self, country=None, funds=None, ref_date=None, keep_gross=False):
|
|
72
72
|
'''
|
|
73
73
|
port_series service
|
|
74
74
|
'''
|
|
75
75
|
if country is None and funds is None:
|
|
76
76
|
raise ValueError("Both country and funds cannot be None")
|
|
77
|
-
data = {'country':country, "funds":funds, 'ref_date':ref_date}
|
|
77
|
+
data = {'country':country, "funds":funds, 'ref_date':ref_date, 'keep_gross':keep_gross}
|
|
78
78
|
resp = self.api_call('port_series', method="post", data=data, verify=False)
|
|
79
79
|
series_df = pd.DataFrame(resp).set_index('Date')
|
|
80
80
|
series_df.index = pd.to_datetime(series_df.index)
|
|
81
|
+
series_df = series_df.apply(pd.to_numeric, errors='coerce')
|
|
82
|
+
|
|
81
83
|
return series_df
|
|
82
84
|
|
|
83
85
|
def attribution(self, port_name, ref_curr, ref_date=None, subgroup=None, bench_name=None, port_to_index=True, per='monthly', ini_date=None, rebal_dates_db=False, rebal_period='quarterly', sync_rebal_dates=False, reset_weights=True, backtest_assets=None, vol_model={"name":"ewma", "alpha":0.01}, delta_w=0.01, quant=0.95, var_normal=True, counter_assets=None, filter_market_val=False, dur_contrib_field='Duration', retrieve_returns=False, lookthrough=False):
|
|
@@ -112,23 +112,8 @@ class risk_data(quantim):
|
|
|
112
112
|
raise ValueError('Extension must be csv. Please check file.')
|
|
113
113
|
if not np.any(np.in1d(filename.split('.')[-2], ['LIMITES_GEN', 'LIMITES_GEN_AGG', 'EMISIONES', 'Agregacion'])):
|
|
114
114
|
raise ValueError('You can only load LIMITES_GEN.csv, LIMITES_GEN_AGG.csv, EMISIONES.csv or Agregacion.csv. Please check file name.')
|
|
115
|
-
|
|
116
|
-
if get_csv_separator(file_path)!=";":
|
|
117
|
-
raise ValueError('Separator must be semi-colon (;). Please check file.')
|
|
118
|
-
|
|
119
|
-
# Read new file:
|
|
120
|
-
try:
|
|
121
|
-
df_new = pd.read_csv(file_path, sep=sep, encoding=encoding)
|
|
122
|
-
except:
|
|
123
|
-
raise ValueError("Cannot read file. Check path and encoding.")
|
|
124
115
|
|
|
125
|
-
|
|
126
|
-
payload = df_new.to_dict(orient='records')
|
|
127
|
-
data = {'bucket':'condor-sura', 'file_name':f'inputs/risk/static/{filename}', 'payload':payload, 'sep':sep, 'overwrite':True, 'encoding':encoding}
|
|
128
|
-
try:
|
|
129
|
-
resp = self.api_call('load_data_s3', method="post", data=data, verify=False)
|
|
130
|
-
except:
|
|
131
|
-
resp = {'success':False, 'message':'Check permissions!'}
|
|
116
|
+
resp = self.upload_with_presigned_url(file_path, "condor-sura", f"inputs/portfolios/nav/CO/{filename}")
|
|
132
117
|
return resp
|
|
133
118
|
|
|
134
119
|
def get_irl(self, ref_date=None, return_cfs=False):
|
|
@@ -170,6 +155,22 @@ class risk_data(quantim):
|
|
|
170
155
|
resp = self.upload_with_presigned_url(file_path, "condor-sura", f"inputs/portfolios/buy_sell/CO/{filename}")
|
|
171
156
|
return resp
|
|
172
157
|
|
|
158
|
+
def load_navs(self, file_path, country='CO'):
|
|
159
|
+
'''
|
|
160
|
+
Load fund series (NAVs).
|
|
161
|
+
'''
|
|
162
|
+
# Load data
|
|
163
|
+
|
|
164
|
+
if country=='CO':
|
|
165
|
+
filename = file_path.split("/")[-1]
|
|
166
|
+
if filename not in ['BD_PAS.csv']:
|
|
167
|
+
raise ValueError('file name not supported.')
|
|
168
|
+
else:
|
|
169
|
+
resp = self.upload_with_presigned_url(file_path, "condor-sura", f"inputs/portfolios/nav/CO/{filename}")
|
|
170
|
+
else:
|
|
171
|
+
raise ValueError("country not supported.")
|
|
172
|
+
return resp
|
|
173
|
+
|
|
173
174
|
def port_contrib(self, start_date, end_date, names, groupers=["secType"], subgroup=False):
|
|
174
175
|
'''
|
|
175
176
|
Portfolio risk an return ex-post contribution.
|
|
File without changes
|
{pyquantimclient-1.0.87 → pyquantimclient-1.0.91}/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
|