PyQuantimClient 2.0.54__tar.gz → 2.0.56__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.54 → pyquantimclient-2.0.56}/PKG-INFO +1 -1
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/PyQuantimClient.egg-info/PKG-INFO +1 -1
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/setup.py +1 -1
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/risk.py +30 -3
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/PyQuantimClient.egg-info/SOURCES.txt +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/PyQuantimClient.egg-info/dependency_links.txt +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/PyQuantimClient.egg-info/top_level.txt +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/README.md +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/setup.cfg +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/__init__.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/alm.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/api.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/benchmarks.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/bi.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/credit.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/data.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/energy.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/performance.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/portfolios.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/preprocess_co.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/private_debt.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/product.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/src/returns.py +0 -0
- {pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/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.56',
|
|
8
8
|
description='Python client to access quantIM services',
|
|
9
9
|
author='Daniel Velasquez',
|
|
10
10
|
author_email='daniel.velasquez@sura-im.com',
|
|
@@ -3,6 +3,7 @@ import re
|
|
|
3
3
|
import pandas as pd
|
|
4
4
|
import numpy as np
|
|
5
5
|
import datetime as dt
|
|
6
|
+
import requests, io
|
|
6
7
|
from dateutil.relativedelta import relativedelta as rd
|
|
7
8
|
from .api import quantim
|
|
8
9
|
from .utils import generate_unique_id, generate_timestamp
|
|
@@ -233,8 +234,11 @@ class risk_data(quantim):
|
|
|
233
234
|
data = {'ref_date':ref_date, 'return_cfs':return_cfs}
|
|
234
235
|
resp = self.api_call('irl', method="post", data=data, verify=False)
|
|
235
236
|
irl_report = pd.DataFrame(resp['irl'])
|
|
236
|
-
cfs =
|
|
237
|
-
|
|
237
|
+
cfs = None
|
|
238
|
+
# cfs_bkup = pd.read_csv(resp['cf_url']) if return_cfs else None
|
|
239
|
+
if return_cfs:
|
|
240
|
+
irl_cfs = requests.get(resp['cf_url'], verify=False)
|
|
241
|
+
cfs = pd.read_csv(io.StringIO(irl_cfs.content.decode('utf-8-sig')), sep=',')
|
|
238
242
|
return irl_report, cfs
|
|
239
243
|
|
|
240
244
|
def load_series_cl(self, file_path_performance=None, file_path_peers=None):
|
|
@@ -332,7 +336,7 @@ class risk_data(quantim):
|
|
|
332
336
|
patron = r"^Positions_(\d{8})\.csv$"
|
|
333
337
|
match = re.match(patron, filename)
|
|
334
338
|
if not match:
|
|
335
|
-
raise ValueError('You can only update files named
|
|
339
|
+
raise ValueError('You can only update files named Positions_YYYYMMDD.csv. Please check.')
|
|
336
340
|
# validar que la fecha sea valida
|
|
337
341
|
fecha_str = match.group(1)
|
|
338
342
|
try:
|
|
@@ -343,4 +347,27 @@ class risk_data(quantim):
|
|
|
343
347
|
key= f"inputs/portfolios/CO/{filename}"
|
|
344
348
|
bucket="condor-sura"
|
|
345
349
|
resp = self.upload_with_presigned_url(file_path, bucket, key, prefix)
|
|
350
|
+
return resp
|
|
351
|
+
|
|
352
|
+
def load_haircuts(self, file_path):
|
|
353
|
+
'''
|
|
354
|
+
Load haircuts banrep.
|
|
355
|
+
'''
|
|
356
|
+
# Load data
|
|
357
|
+
filename = file_path.split("/")[-1]
|
|
358
|
+
# validar el nombre del archivo
|
|
359
|
+
patron = r"^haircuts_(\d{6})\.xlsx$"
|
|
360
|
+
match = re.match(patron, filename)
|
|
361
|
+
if not match:
|
|
362
|
+
raise ValueError('You can only update files named haircuts_YYYYMM.xlsx. Please check.')
|
|
363
|
+
# validar que la fecha sea valida
|
|
364
|
+
fecha_str = match.group(1)
|
|
365
|
+
try:
|
|
366
|
+
dt.datetime.strptime(fecha_str, "%Y%m")
|
|
367
|
+
except ValueError:
|
|
368
|
+
raise ValueError('The date is not valid. Format must be YYYYMM')
|
|
369
|
+
prefix="inputs/risk/varliquid/haircuts/haircuts_"
|
|
370
|
+
key= f"inputs/risk/varliquid/haircuts/{filename}"
|
|
371
|
+
bucket="condor-sura"
|
|
372
|
+
resp = self.upload_with_presigned_url(file_path, bucket, key, prefix)
|
|
346
373
|
return resp
|
|
File without changes
|
{pyquantimclient-2.0.54 → pyquantimclient-2.0.56}/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
|
|
File without changes
|
|
File without changes
|