getting canadian exchange rates in python

Simple script to get the current exchange rates from the bank of canada

import requests

r = requests.get('http://www.bankofcanada.ca/valet/observations/group/FX_RATES_DAILY/json')
rates = r.json()
date = rates['observations'][-1]['d']
rate = rates['observations'][-1]['FXUSDCAD']['v']

Previous: wordpress plugin update error: PCLZIP_ERR_BAD_FORMAT Next: solar eclipse as experienced by solar panels