Skip to content

CAD -> USD rate stuck? #151

Open
Open
@DLu

Description

@DLu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions