Skip to content

Instantly share code, notes, and snippets.

@EdwardNavarro
Forked from cdiaz/TrmSoapClient.py
Created March 27, 2019 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EdwardNavarro/4f326f8f58028b0b32fb7e88bce25f1a to your computer and use it in GitHub Desktop.
Save EdwardNavarro/4f326f8f58028b0b32fb7e88bce25f1a 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
#!/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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment