def ecb(base, target):
    """Parse data from European Central Bank."""
    api_url = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'
    resp = requests.get(api_url, timeout=1)
    text = resp.text

    def _find_rate(symbol):
        if symbol == 'EUR':
            return decimal.Decimal(1.00)
        m = re.findall(r"currency='%s' rate='([0-9\.]+)'" % symbol, text)
        return decimal.Decimal(m[0])

    return _find_rate(target) / _find_rate(base)