Skip to main content

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

Project description

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/library.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commondata_languages-1.1.0.tar.gz (96.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commondata_languages-1.1.0-py3-none-any.whl (103.4 kB view details)

Uploaded Python 3

File details

Details for the file commondata_languages-1.1.0.tar.gz.

File metadata

  • Download URL: commondata_languages-1.1.0.tar.gz
  • Upload date:
  • Size: 96.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for commondata_languages-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c08f22f6713204ef56a3e9ddad59e343fa0ddce22e21cc25cc37a19d2de3ccba
MD5 c211f1252503362ceb84ea2a6e05dd88
BLAKE2b-256 a7a400175dcf0c3af8d11774946fe7620a4a74f540d3db5f7bfad5fc207d8250

See more details on using hashes here.

File details

Details for the file commondata_languages-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for commondata_languages-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e39963d77ab4f563597a450215606e46f25aa944c30dcf117460e6c1cd0825cd
MD5 19fd24dbb035f92420db4dcc8d5eea3e
BLAKE2b-256 221bca1bce230cf4157c2ae95249aa86e047718070f19627f925e48610b611dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page