Last active
February 28, 2025 21:45
-
-
Save cdiaz/a623334ee994a836cba3 to your computer and use it in GitHub Desktop.
Obtener La tasa de cambio representativa del mercado (TRM) para Colombia consumiendo el webservice de la Superintentencia Financiera desde Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from suds.client import Client | |
import time | |
WSDL_URL = 'https://www.superfinanciera.gov.co/SuperfinancieraWebServiceTRM/TCRMServicesWebService/TCRMServicesWebService?WSDL' | |
date = time.strftime('%Y-%m-%d') | |
def trm(date): | |
try: | |
client = Client(WSDL_URL, location=WSDL_URL, faults=True) | |
trm = client.service.queryTCRM(date) | |
except Exception as e: | |
return str(e) | |
return trm | |
print trm(date) |
Funciona, pero sólo para USD, de CAD alguien conoce?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Muchas gracias me sirvio ese!