MicroPyramid / forex-python

Foreign exchange rates, Bitcoin price index and currency conversion using ratesapi.io
http://forex-python.readthedocs.io/en/latest/usage.html
MIT License
661 stars 195 forks source link

get_rate missing 'dest_cur' #116

Closed fornakter closed 2 years ago

fornakter commented 2 years ago

Im try to use forex-python and recive an error: TypeError: get_rate() missing 1 required positional argument: 'dest_cur' CODE: `from forex_python.converter import CurrencyRates c = CurrencyRates

print(c.get_rate('USD', 'GBP'))`

leozitor commented 2 years ago

try

c = CurrencyRates()

print(c.get_rate('USD', 'GBP'))
MJ-Kim-dev commented 2 years ago

Same issue for me.

c = CurrencyRates() c.get_rate('USD') Traceback (most recent call last): File "", line 1, in TypeError: get_rate() missing 1 required positional argument: 'dest_cur'

print(c.get_rate('usd')) Traceback (most recent call last): File "", line 1, in TypeError: get_rate() missing 1 required positional argument: 'dest_cur' print(c.get_rate('USD', 'CAD')) Traceback (most recent call last): File "", line 1, in File "/home/ubuntu/env/lib/python3.8/site-packages/forex_python/converter.py", line 74, in get_rate rate = self._get_decoded_rate(response, dest_cur, date_str=date_str) File "/home/ubuntu/env/lib/python3.8/site-packages/forex_python/converter.py", line 47, in _get_decoded_rate return self._decode_rates( File "/home/ubuntu/env/lib/python3.8/site-packages/forex_python/converter.py", line 40, in _decode_rates decoded_data = response.json() File "/home/ubuntu/env/lib/python3.8/site-packages/requests/models.py", line 910, in json return complexjson.loads(self.text, **kwargs) File "/home/ubuntu/env/lib/python3.8/site-packages/simplejson/init.py", line 525, in loads return _default_decoder.decode(s) File "/home/ubuntu/env/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/home/ubuntu/env/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

ashwin31 commented 2 years ago

Thank you @leozitor