iso639-lang
iso639-lang is a simple library to handle the ISO 639 series of international standards for language codes.
>>> from iso639 import Lang
>>> Lang("fr")
Lang(name='French', pt1='fr', pt2b='fre', pt2t='fra', pt3='fra', pt5='')
iso639-lang allows you to switch from one language code to another easily.
There’s no need to manually download or parse data files, just use the Lang class!
ISO 639-1, ISO 639-2, ISO 639-3 and ISO 639-5 parts are all supported.
Installing iso639-lang and Supported Versions
iso639-lang is available on PyPI:
$ pip install iso639-lang
iso639-lang supports Python 3.6+.
Usage
Handling language codes with iso639-lang is very simple.
Begin by importing the Lang class:
>>> from iso639 import Lang
Lang is instantiable with any ISO 639 language code or name. For example, let’s try to get the ISO 639 codes for French:
>>> lg = Lang("French")
>>> lg.name
'French'
>>> lg.pt1
'fr'
>>> lg.pt2b
'fre'
>>> lg.pt2t
'fra'
>>> lg.pt3
'fra'
>>> lg.pt5
''
An instance of Lang can be modified.
>>> lg.pt1 = 'de'
>>> lg.name
'German'
Lang instances are comparable to each other.
>>> other_lg = Lang("deu")
>>> lg == other_lg
True
Data included in iso639-lang
iso639-lang is based on the official code tables provided by the ISO 639 registration authorities.
| Standard | Name | Registration Authority | First edition | Current |
|---|---|---|---|---|
| ISO 639-1 | Part 1: Alpha-2 code | Infoterm | 1967 | 2002 |
| ISO 639-2 | Part 2: Alpha-3 code | Library of Congress | 1998 | 1998 |
| ISO 639-3 | Part 3: Alpha-3 code for comprehensive coverage of languages | SIL International | 2007 | 2007 |
| ISO 639-4 | Part 4: Implementation guidelines and general principles for language coding (not a list) | ISO/TC 37/SC 2 | 2010 | 2010 |
| ISO 639-5 | Part 5: Alpha-3 code for language families and groups | Library of Congress | 2008 | 2013 |
| ISO 639-6 | Part 6: Alpha-4 representation for comprehensive coverage of language variants | Geolang | 2009 | withdrawn |
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iso639-lang-0.1.0.tar.gz.
File metadata
- Download URL: iso639-lang-0.1.0.tar.gz
- Upload date:
- Size: 81.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7f82acc472cb1e1bbdc06b490b464335fb19e8b333c2f5ef31002bff0f1bdbe
|
|
| MD5 |
e9ef38cb62d496d65ab9faf523e9646d
|
|
| BLAKE2b-256 |
98d023402b08a39e0501ced7691eefd188d504885370e678e9f5a3a4e19b0836
|
File details
Details for the file iso639_lang-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iso639_lang-0.1.0-py3-none-any.whl
- Upload date:
- Size: 81.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee5bf340ba42f8b3eef15776a23ba345c80d5cece8774831fa6662a4a2aac192
|
|
| MD5 |
81727a9e2e966e50b9664fd85290d812
|
|
| BLAKE2b-256 |
43c656df2efa8a5c0ec09869a16a5c141c363a70e313b9e62c79a25277854c0d
|