PyQuantimClient 1.0.62__tar.gz → 1.0.63__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.62 → PyQuantimClient-1.0.63}/PKG-INFO +1 -1
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/PyQuantimClient.egg-info/PKG-INFO +1 -1
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/setup.py +1 -1
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/src/api.py +6 -1
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/src/risk.py +33 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/PyQuantimClient.egg-info/SOURCES.txt +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/PyQuantimClient.egg-info/dependency_links.txt +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/PyQuantimClient.egg-info/top_level.txt +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/README.md +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/setup.cfg +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/src/__init__.py +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/src/benchmarks.py +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/src/bi.py +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/src/data.py +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/src/energy.py +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/src/portfolios.py +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/src/preprocess_co.py +0 -0
- {PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/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.63',
|
|
8
8
|
description='Python client to access quantIM services',
|
|
9
9
|
author='Daniel Velasquez',
|
|
10
10
|
author_email='daniel.velasquez@sura-im.com',
|
|
@@ -47,7 +47,12 @@ class quantim:
|
|
|
47
47
|
else:
|
|
48
48
|
print("Method not supported!")
|
|
49
49
|
return None
|
|
50
|
-
|
|
50
|
+
|
|
51
|
+
try:
|
|
52
|
+
resp = json.loads(api_call_response.text)
|
|
53
|
+
except:
|
|
54
|
+
resp = api_call_response.text
|
|
55
|
+
return resp
|
|
51
56
|
|
|
52
57
|
def retrieve_s3_df(self, bucket, key, sep=','):
|
|
53
58
|
'''
|
|
@@ -138,3 +138,36 @@ class risk_data(quantim):
|
|
|
138
138
|
cfs = pd.read_csv(resp['cf_url']) if return_cfs else None
|
|
139
139
|
|
|
140
140
|
return irl_report, cfs
|
|
141
|
+
|
|
142
|
+
def load_fund_series_cl(self, file_path, sep=";", encoding='utf-8', blocks=1):
|
|
143
|
+
'''
|
|
144
|
+
Load series Chile to s3.
|
|
145
|
+
'''
|
|
146
|
+
# Validate filename:
|
|
147
|
+
filename = file_path.split('/')[-1]
|
|
148
|
+
label = filename.split('.')[-2]
|
|
149
|
+
if filename.split('.')[-1]!='csv':
|
|
150
|
+
raise ValueError('Extension must be csv. Please check file.')
|
|
151
|
+
if not np.any(np.in1d(label, ['series_performance'])):
|
|
152
|
+
raise ValueError('You can only load series_performance.csv')
|
|
153
|
+
|
|
154
|
+
if get_csv_separator(file_path)!=sep:
|
|
155
|
+
raise ValueError(f'Separator must be ({sep}). Please check file.')
|
|
156
|
+
|
|
157
|
+
# Read new file:
|
|
158
|
+
try:
|
|
159
|
+
df_new = pd.read_csv(file_path, sep=sep, encoding=encoding)
|
|
160
|
+
except:
|
|
161
|
+
raise ValueError("Cannot read file. Check path and encoding.")
|
|
162
|
+
|
|
163
|
+
# Load data
|
|
164
|
+
li = int(np.ceil(len(df_new)/blocks))
|
|
165
|
+
for i in range(blocks):
|
|
166
|
+
payload = df_new.iloc[(i*li):(i+1)*li, :].to_dict(orient='records')
|
|
167
|
+
data = {'bucket':'condor-sura', 'file_name':f"inputs/benchmarks/performance/cl/{label}{i if i>0 else ''}.csv", 'payload':payload, 'sep':sep, 'overwrite':True, 'encoding':encoding}
|
|
168
|
+
try:
|
|
169
|
+
resp = self.api_call('load_data_s3', method="post", data=data, verify=False)
|
|
170
|
+
except:
|
|
171
|
+
resp = {'success':False, 'message':'Check permissions or file size!'}
|
|
172
|
+
return resp
|
|
173
|
+
return resp
|
|
File without changes
|
{PyQuantimClient-1.0.62 → PyQuantimClient-1.0.63}/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
|