1 year ago

#93816

test-img

gregorp

Forex Python inconsistent rates

I'm getting inconsistent results from the Python Forex package:

from forex_python.converter import CurrencyRates, get_rate
from datetime import datetime
rate_list = []
for i in range(10):
    rate_list.append(get_rate('EUR', 'USD', datetime(2021, 1, 12)))
print(set(rate_list))
{1.1304, 1.2161}

Since I'm always fetching the same rate on the same date, I would expect that rate_list will consist of only 1 unique element. Is this a known issue or am I missing something?

python

forex

0 Answers

Your Answer

Accepted video resources