Closed AtomicNess123 closed 3 years ago
Sorry but this package does not aim at listing language code mappings. That said, you can still probably generate the data your are looking for from Lang._data
:
>>> from iso639 import Lang
>>> [(d["name"], pt3) for pt3, d in Lang._data["pt3"].items()]
[('Ghotuo', 'aaa'), ('Alumu-Tesu', 'aab'), ... , ('Zaza', 'zza'), ('Zuojiang Zhuang', 'zzj')]
Thanks so much. These are three letter codes. Are there also two letter codes (eg., EN, RU, FR)?
Just replace pt3
bypt1
:
>>> [(d["name"], pt1) for pt1, d in Lang._data["pt1"].items()]
[('Afar', 'aa'), ('Abkhazian', 'ab'), ... , ('Chinese', 'zh'), ('Zulu', 'zu')]
Silly me, thanks!
Since v2.0, you can now iterate more easily and efficiently through all possible Lang
instances with iter_langs
:
>>> from iso639 import iter_langs
>>> [(lang.name, lang.pt3) for lang in iter_langs() if lang.pt3]
[("'Are'are", 'alu'), ("'Auhelawa", 'kud'), ... , ('ǂUngkue', 'gku'), ('ǃXóõ', 'nmn')]
How to get a paired list of language and iso codes from the package? Thanks.