PyQuantimClient 2.0.75__py3-none-any.whl → 2.0.77__py3-none-any.whl
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/risk.py +42 -1
- {pyquantimclient-2.0.75.dist-info → pyquantimclient-2.0.77.dist-info}/METADATA +1 -1
- {pyquantimclient-2.0.75.dist-info → pyquantimclient-2.0.77.dist-info}/RECORD +5 -5
- {pyquantimclient-2.0.75.dist-info → pyquantimclient-2.0.77.dist-info}/WHEEL +0 -0
- {pyquantimclient-2.0.75.dist-info → pyquantimclient-2.0.77.dist-info}/top_level.txt +0 -0
PyQuantimClient/risk.py
CHANGED
|
@@ -424,4 +424,45 @@ class risk_data(quantim):
|
|
|
424
424
|
if filename.split('.')[-1]!='csv':
|
|
425
425
|
raise ValueError('Extension must be csv. Please check file.')
|
|
426
426
|
resp = self.upload_with_presigned_url(file_path, "condor-sura", f"inputs/portfolios/mappings/PE/{filename}")
|
|
427
|
-
return resp
|
|
427
|
+
return resp
|
|
428
|
+
|
|
429
|
+
def load_ret_peers_mx(self, file_path):
|
|
430
|
+
'''
|
|
431
|
+
Load Mexico peers rets to s3.
|
|
432
|
+
'''
|
|
433
|
+
# Validar extension:
|
|
434
|
+
filename = file_path.split('/')[-1]
|
|
435
|
+
if filename.split('.')[-1]!='csv':
|
|
436
|
+
raise ValueError('Extension must be csv. Please check file.')
|
|
437
|
+
# Validar separador
|
|
438
|
+
try:
|
|
439
|
+
df = pd.read_csv(file_path, sep=";", nrows=5)
|
|
440
|
+
if df.shape[1] == 1:
|
|
441
|
+
raise ValueError('Por favor valide el separador del archivo, debe ser punto y coma (;).')
|
|
442
|
+
except Exception as e:
|
|
443
|
+
raise ValueError(str(e))
|
|
444
|
+
resp = self.upload_with_presigned_url(file_path, "condor-sura", f"inputs/benchmarks/peers/MX/{filename}")
|
|
445
|
+
return resp
|
|
446
|
+
|
|
447
|
+
def download_limits_outputs(self, country, ref_date, bucket="condor-sura"):
|
|
448
|
+
'''
|
|
449
|
+
Get limits output
|
|
450
|
+
'''
|
|
451
|
+
try:
|
|
452
|
+
date = dt.datetime.strptime(ref_date,"%Y-%m-%d")
|
|
453
|
+
except:
|
|
454
|
+
print(f"El argumento ref_date debe ser una fecha en formato YYYY-MM-DD. Por favor validar.")
|
|
455
|
+
return None
|
|
456
|
+
try:
|
|
457
|
+
key_res = f"output/limits/{country}/{ref_date.replace('-','/')}/control_resumen_{ref_date.replace('-','')}.csv"
|
|
458
|
+
url_res = self.retrieve_s3_df(bucket, key_res, sep = "|", res_url = True, prefix=f"output/limits/{country}/")
|
|
459
|
+
resumen = requests.get(url_res, verify=False)
|
|
460
|
+
df_resumen = pd.read_csv(io.StringIO(resumen.content.decode('utf-8-sig')), sep="|")
|
|
461
|
+
key_det = f"output/limits/{country}/{ref_date.replace('-','/')}/control_detalle_{ref_date.replace('-','')}.csv"
|
|
462
|
+
url_det = self.retrieve_s3_df(bucket, key_det, sep = "|", res_url = True, prefix=f"output/limits/{country}/")
|
|
463
|
+
detalle = requests.get(url_det, verify=False)
|
|
464
|
+
df_detalle = pd.read_csv(io.StringIO(detalle.content.decode('utf-8-sig')), sep="|")
|
|
465
|
+
except Exception as e:
|
|
466
|
+
print(f"Error al obtener archivos de limites para la fecha {ref_date}: {e}")
|
|
467
|
+
return None
|
|
468
|
+
return df_resumen, df_detalle
|
|
@@ -13,9 +13,9 @@ PyQuantimClient/preprocess_co.py,sha256=sdQuuxK1bfjY-Wp87xt7f9yFN_9WiJf4QiBNGy-4
|
|
|
13
13
|
PyQuantimClient/private_debt.py,sha256=Eeg7CgXa_mE0DTvvOfsVH_I0s_3cmkrVAOczBxznCzU,683
|
|
14
14
|
PyQuantimClient/product.py,sha256=fTachNfN35m4peLtXm7WAWgERxfBITYNsb4agW4bZuM,929
|
|
15
15
|
PyQuantimClient/returns.py,sha256=r2PruoqvPdfZ4uGgWb0rA9nz4wUXf5R5rDLPYjlpXOM,3143
|
|
16
|
-
PyQuantimClient/risk.py,sha256=
|
|
16
|
+
PyQuantimClient/risk.py,sha256=iAWr0FPv3xBI3KO4kx37c6UeKcds9dMUp7x_CFyeoyc,21475
|
|
17
17
|
PyQuantimClient/utils.py,sha256=d_hyKTeHzQuPVusrbZJEhtbp6srninQCErKDfe6HH2w,941
|
|
18
|
-
pyquantimclient-2.0.
|
|
19
|
-
pyquantimclient-2.0.
|
|
20
|
-
pyquantimclient-2.0.
|
|
21
|
-
pyquantimclient-2.0.
|
|
18
|
+
pyquantimclient-2.0.77.dist-info/METADATA,sha256=0aiF3NWsPchle-HvqXWyPLcJ0q98hYSg2F5UxM4ef0w,447
|
|
19
|
+
pyquantimclient-2.0.77.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
20
|
+
pyquantimclient-2.0.77.dist-info/top_level.txt,sha256=WbmxYSegJ1EfH-TJOqtF0mzYevWDeaMoJ4ZAzQaOTDE,16
|
|
21
|
+
pyquantimclient-2.0.77.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|