This is an unofficial Python wrapper for free ExchangeRatesAPI, which provides exchange rate lookups courtesy of the Central European Bank. It features a number of useful functions and can be installed easily using pip. Additionally wrapper is providing CLI interface.
pip install exchangeratesapi
from exchangeratesapi import rates
latest = rates.latest()
latest["base"]
latest["date"]
latest = rates.Rates()
latest.base
latest.date
history = rates.history(start_at="2020-01-01", end_at="2020-12-31", base="PLN")
history["base"]
history["start_at"]
history["end_at"]
history = rates.HistoryRates(start_at="2020-01-01", end_at="2020-12-31", base="PLN")
history.base
history.start_at
history.end_at