forex-python
forex-python copied to clipboard
No data past 12th June 2021 for USD to EUR pair
Currently using v1.6 :
When I run for dates before the 12th all is fine
get_rate('USD','EUR' , datetime.datetime.strptime('2021-06-11','%Y-%m-%d'))
0.8247422680412372
however when I try for 12th or later I get
get_rate('USD','EUR' , datetime.datetime.strptime('2021-06-12', '%Y-%m-%d'))
RatesNotAvailableError Traceback (most recent call last) ipython-input-54-01a85e164fe5 in module get_rate('USD','EUR' , datetime.datetime.strptime('2021-06-12', '%Y-%m-%d')) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\forex_python\converter.py in get_rate(self, base_cur, dest_cur, date_obj) 77 base_cur, dest_cur, date_str)) 78 return rate 79 raise RatesNotAvailableError("Currency Rates Source Not Ready") 80 81 def convert(self, base_cur, dest_cur, amount, date_obj=None): RatesNotAvailableError: Currency Rates Source Not Ready
Wait this is just weekends, is there is there a workaround for weekend data other than just the error using last days data etc?
Usually rates are not updated over the weekends, so there isn't much you can do
Best is to have at least a way to continue. Maybe take the last non weekend rate? Plus of course show a better error message. We also have this issue.