PyQuantimClient 2.0.72__py3-none-any.whl → 2.0.74__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 +39 -2
- {pyquantimclient-2.0.72.dist-info → pyquantimclient-2.0.74.dist-info}/METADATA +1 -1
- {pyquantimclient-2.0.72.dist-info → pyquantimclient-2.0.74.dist-info}/RECORD +5 -5
- {pyquantimclient-2.0.72.dist-info → pyquantimclient-2.0.74.dist-info}/WHEEL +0 -0
- {pyquantimclient-2.0.72.dist-info → pyquantimclient-2.0.74.dist-info}/top_level.txt +0 -0
PyQuantimClient/risk.py
CHANGED
|
@@ -95,6 +95,43 @@ class risk_data(quantim):
|
|
|
95
95
|
raise ValueError("Error: No se ha podido iniciar el proceso de var formato 386 o ya existe una ejecución en curso. Intente de nuevo en algunos minutos.")
|
|
96
96
|
return None
|
|
97
97
|
|
|
98
|
+
def run_pat(self, start_date, end_date, country="CO"):
|
|
99
|
+
'''
|
|
100
|
+
Run performance colombia.
|
|
101
|
+
'''
|
|
102
|
+
# Validación de formato
|
|
103
|
+
try:
|
|
104
|
+
dt.datetime.strptime(start_date, "%Y-%m-%d")
|
|
105
|
+
except:
|
|
106
|
+
raise ValueError(f"start_date '{start_date}' no tiene el formato string yyyy-mm-dd")
|
|
107
|
+
|
|
108
|
+
try:
|
|
109
|
+
dt.datetime.strptime(end_date, "%Y-%m-%d")
|
|
110
|
+
except:
|
|
111
|
+
raise ValueError(f"end_date '{end_date}' no tiene el formato string yyyy-mm-dd")
|
|
112
|
+
|
|
113
|
+
data = {
|
|
114
|
+
'jobname': 'job_proc_pat',
|
|
115
|
+
"add_args": {
|
|
116
|
+
"--countries": f'["{country}"]',
|
|
117
|
+
"--start_date": start_date,
|
|
118
|
+
"--end_date": end_date
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
try:
|
|
123
|
+
resp = self.api_call('run_glue_job', method="post", data=data, verify=False)
|
|
124
|
+
msg = (
|
|
125
|
+
f"La ejecucion performance para {country} entre las fechas {start_date} - {end_date} se ha activado exitosamente"
|
|
126
|
+
if resp['status'] == 'RUNNING'
|
|
127
|
+
else "Error: No se ha podido iniciar el proceso performance o ya existe una ejecución en curso. Intente de nuevo en algunos minutos."
|
|
128
|
+
)
|
|
129
|
+
print(msg)
|
|
130
|
+
except:
|
|
131
|
+
raise ValueError("Error: No se ha podido iniciar el proceso performance o ya existe una ejecución en curso. Intente de nuevo en algunos minutos.")
|
|
132
|
+
|
|
133
|
+
return None
|
|
134
|
+
|
|
98
135
|
def get_portfolio(self, client_id=None, port_type=None, ref_date=None):
|
|
99
136
|
'''
|
|
100
137
|
Get portfolio
|
|
@@ -202,7 +239,7 @@ class risk_data(quantim):
|
|
|
202
239
|
df = None
|
|
203
240
|
return df
|
|
204
241
|
|
|
205
|
-
def load_limits_params(self, file_path,
|
|
242
|
+
def load_limits_params(self, file_path, country):
|
|
206
243
|
'''
|
|
207
244
|
Load limits parameters file to s3.
|
|
208
245
|
'''
|
|
@@ -210,7 +247,7 @@ class risk_data(quantim):
|
|
|
210
247
|
filename = file_path.split('/')[-1]
|
|
211
248
|
if filename.split('.')[-1]!='csv':
|
|
212
249
|
raise ValueError('Extension must be csv. Please check file.')
|
|
213
|
-
resp = self.upload_with_presigned_url(file_path, "condor-sura", f"inputs/risk/limits/
|
|
250
|
+
resp = self.upload_with_presigned_url(file_path, "condor-sura", f"inputs/risk/limits/{country}/{filename}")
|
|
214
251
|
return resp
|
|
215
252
|
|
|
216
253
|
def load_pretrade_inputs(self, file_path):
|
|
@@ -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=4ymwOlAOTI9cTtKatojThPnCxz5-mdH9Z2PuXOUDYUk,19247
|
|
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.74.dist-info/METADATA,sha256=aE8RHl_vE5BOiNqIlBX4cAcMrqjPKM3LWE1171RZZas,447
|
|
19
|
+
pyquantimclient-2.0.74.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
20
|
+
pyquantimclient-2.0.74.dist-info/top_level.txt,sha256=WbmxYSegJ1EfH-TJOqtF0mzYevWDeaMoJ4ZAzQaOTDE,16
|
|
21
|
+
pyquantimclient-2.0.74.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|