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
Release history Release notifications | RSS feed
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c08f22f6713204ef56a3e9ddad59e343fa0ddce22e21cc25cc37a19d2de3ccba
|
|
| MD5 |
c211f1252503362ceb84ea2a6e05dd88
|
|
| BLAKE2b-256 |
a7a400175dcf0c3af8d11774946fe7620a4a74f540d3db5f7bfad5fc207d8250
|
File details
Details for the file commondata_languages-1.1.0-py3-none-any.whl.
File metadata
- Download URL: commondata_languages-1.1.0-py3-none-any.whl
- Upload date:
- Size: 103.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.13.2 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e39963d77ab4f563597a450215606e46f25aa944c30dcf117460e6c1cd0825cd
|
|
| MD5 |
19fd24dbb035f92420db4dcc8d5eea3e
|
|
| BLAKE2b-256 |
221bca1bce230cf4157c2ae95249aa86e047718070f19627f925e48610b611dd
|