LBeaudoux / iso639

A fast, simple ISO 639 library.
MIT License
33 stars 5 forks source link

Greek error #12

Closed evilsh3ll closed 2 years ago

evilsh3ll commented 2 years ago

Hello, when I try to parse print(Lang("Greek").pt2b) the language "Greek" I get this error:

    raise InvalidLanguageValue(*args, **kwargs)
iso639.exceptions.InvalidLanguageValue: (*('Greek',), **{}). Only valid ISO 639 language values are supported as arguments.

Do you know why? Greek should be included in iso639-2 Which iso standard should I use in order to get Greek included too?

LBeaudoux commented 2 years ago

Thanks for asking this question. The names used by this library are the ISO 639-3 reference language names and ISO 639-5 English names. For Greek, you have to choose between Modern Greek (1453-) and Ancient Greek (to 1453).

>>> from iso639 import Lang
>>> Lang('Modern Greek (1453-)')
Lang(name='Modern Greek (1453-)', pt1='el', pt2b='gre', pt2t='ell', pt3='ell', pt5='')
>>> Lang('Ancient Greek (to 1453)')
Lang(name='Ancient Greek (to 1453)', pt1='', pt2b='grc', pt2t='grc', pt3='grc', pt5='')
evilsh3ll commented 2 years ago

Thank you for the fast response