Alir3z4 / python-currencies

Display money format and its filthy currencies, for all money lovers out there.
http://pypi.python.org/pypi/currencies
GNU General Public License v3.0
72 stars 13 forks source link

Should symbol work? #3

Closed mmic closed 4 years ago

mmic commented 6 years ago

Should this work?

>>> pycountry.currencies.lookup(u'EUR')
Currency(alpha_3='EUR', name='Euro', numeric='978')
>>> pycountry.currencies.lookup(u'€')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/michele/bitbucket/splitti/telegram/venv36/lib/python3.6/site-packages/pycountry/db.py", line 43, in load_if_needed
    return f(self, *args, **kw)
  File "/Users/michele/bitbucket/splitti/telegram/venv36/lib/python3.6/site-packages/pycountry/db.py", line 121, in lookup
    raise LookupError('Could not find a record for %r' % value)
LookupError: Could not find a record for '€'
GeoffRiley commented 4 years ago

Judging by the package names I would say that you are asking in the wrong place. I expect that after almost two years you have already realised this, but if it is still a problem(!) I think you will find that you are using pycountry. …and a quick look at the code suggests to me that the answer is no, it doesn't provide a lookup for currency symbol: this is because (as far as I can see) the databases used do not contain the symbols.

Alir3z4 commented 4 years ago

@GeoffRiley thank you for clarification and answering this issue.

No sure how it could slipped form my attention in the whole time.