Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAD -> USD rate stuck? #151

Open
DLu opened this issue Jan 11, 2024 · 0 comments
Open

CAD -> USD rate stuck? #151

DLu opened this issue Jan 11, 2024 · 0 comments

Comments

@DLu
Copy link

DLu commented Jan 11, 2024

I'm having a problem where certain currency conversions are returning the same rate every time.

CAD to USD

>>> from forex_python.converter import CurrencyRates
>>> import datetime
>>> rates = CurrencyRates()
>>> rates.get_rate('CAD', 'USD', datetime.date(2023, 12, 6))
0.7309005691329092
>>> rates.get_rate('CAD', 'USD', datetime.date(2023, 12, 7))
0.7309005691329092

USD to CAD

The same is not true of the inverse.

>>> 1 / rates.get_rate('USD', 'CAD', datetime.date(2023, 12, 6))
0.7385159010600706
>>> 1 / rates.get_rate('USD', 'CAD', datetime.date(2023, 12, 7))
0.7358503401360544

Version

>>> from importlib.metadata import version
>>> version('forex_python')
'1.8'

I have also confirmed that the rates do not match what is found in the Europa data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant