import requests


def get_currency_rates(base):
    """
    Downloads data for selected base currency from ExchangeRatesAPI.

    Parameters
    ----------
    base : str
        Currency code in 3-letter code format or as symbol.

    Returns
    -------
    dict
        Conversion rates for selected bsae currency.
    """

    URL = "https://api.exchangeratesapi.io/latest?base={}".format(base)

    try:
        response = requests.get(URL)
        response.raise_for_status()
        return response.json()["rates"]
    except requests.exceptions.HTTPError as err:
        print("Http Error: ", err)
    except requests.exceptions.ConnectionError as errc:
        print("Connection Error: ", errc)
    except requests.exceptions.Timeout as errt:
        print("Timeout Error: ", errt)
    except requests.exceptions.RequestException as e:
        print("Oops: ", e)