A simple library for ISO 639-1 and ISO 639-3 language codes.
This library requires Python 3.6.
pip3 install iso639-lang
>>> from iso639 import Lang
>>> language = Lang("fr")
>>> language.pt1
'fr'
>>> language.pt3
'fra'
>>> language.name
'French'
>>> language.pt3 = 'eng'
>>> language.pt1
'en'
>>> language.name
'English'
>>> language.name = 'German'
>>> language.pt1
'de'
>>> language.pt3
'deu'
>>> other_language = Lang("de")
>>> language == other_language
True
- ISO 639-3 Code Set, dated 2020-01-20