Skip to content

Work with ISO 639-1, ISO 639-2B, ISO 639-2T, and ISO 639-3 language data.

License

Notifications You must be signed in to change notification settings

commondata-net/commondata-languages-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commondata-languages

Work with ISO 639-1, ISO 639-2B, ISO 639-2T, and ISO 639-3 language data.

List, lookup with fuzzy search.

Installation

pip install commondata-languages

Usage

Iterate over all languages:

from commondata_languages import LanguageData

languages = LanguageData()

for language in languages:
    print(language.name)

List all languages:

from commondata_languages import LanguageData

languages = LanguageData()

print(languages.all())

Lookup a language

from commondata_languages import LanguageData

languages = LanguageData()

# Lookup by name (case insensitive, fuzzy search)
language = languages["Hindi"]

# Lookup by ISO 639-1
language = languages["en"]

# Lookup by ISO 639-3
language = languages["eng"]

# Lookup by ISO 639-2B
language = languages["chi"]

# Lookup by ISO 639-2T
language = languages["zho"]

# Look up with fuzzy search
language = languages["Englih"]

print(language)
> Language(name='English', iso1='en', iso2b='eng', iso2t='eng', iso3='eng', scope='Individual', type='Living')

Use CLI to lookup a language

python -m commondata-languages English

Load languages data into pandas dataframe

import pandas as pd

from commondata_languages.data import languages

df = pd.DataFrame(languages)

Other Formats and Datasets

Download CSV, XLSX, JSON and YAML files from commondata.net/languages.

commondata.net maintains a collection of essential datasets in a variety of formats, including python bindings. Check out the full library here: commondata.net/library.

Contributing

Contributions are welcome! Please open an issue or submit a pull request here.

License

This project is licensed under GPLv3. See the LICENSE file for details.

Support

For feedback, feature requests, or support, please email support@commondata.net.

About

Work with ISO 639-1, ISO 639-2B, ISO 639-2T, and ISO 639-3 language data.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages