babelfish
A module to work with countries and languages
What it is and what it does
BabelFish is a reference library for working with ISO-standardized country, language, and script identifiers in Python. It wraps ISO-3166 (countries), ISO-639-3 (languages), and ISO-15924 (scripts) into Python objects, allowing you to construct and query them by code, name, or other attributes. The library includes built-in converters for common alternate naming schemes (e.g., alpha2, alpha3b, opensubtitles for languages; country names for countries), making it easy to map between different coding systems without maintaining your own lookup tables.
Typical use cases include building multilingual applications, normalizing user-supplied language or country inputs, and working with subtitle or media metadata that uses non-standard language codes. The package is lightweight, has no heavy external dependencies, and works across modern Python versions.
Use it for:
- Normalize user-supplied language codes (e.g., 'en', 'eng', 'English') into a canonical Language object for downstream processing.
- Map between different language coding schemes (ISO-639-3, alpha2, OpenSubtitles codes) in subtitle or media applications.
- Build locale-aware applications by looking up country and language metadata from ISO codes.
- Validate and parse language-country pairs (e.g., Portuguese from Brazil) with script support.
- Populate dropdown menus or search filters with standardized country and language names.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
BabelFish provides Python objects for countries, languages, and scripts based on ISO standards, with built-in converters to translate between different naming and coding schemes.
Yes, if you need a lightweight, standards-based reference for countries, languages, and scripts. The package is stable, permissively licensed, and has no security vulnerabilities. Install friction is minimal. The main caveat is dormant maintenance—827 days since last release—so if you need active support or expect frequent updates for new Python versions, verify that the current release works with your target environment before committing.
Install
babelfish on PyPI
pip
pip install babelfishuv
uv add babelfishpoetry
poetry add babelfishInstalling babelfish
Before you install
Low install friction with only two lightweight runtime dependencies (importlib-resources and importlib-metadata). Maintenance is dormant—last release was 827 days ago and the last commit was 2025-02-09—but the package is marked Production/Stable and has no known vulnerabilities, suggesting it is feature-complete rather than abandoned.
License in practice
Licensed under BSD-3-Clause (permissive), which allows commercial and private use with minimal restrictions; you must include a copy of the license and copyright notice.
Quickstart
pip install babelfish
import babelfish
language = babelfish.Language('eng')
country = babelfish.Country('GB')
script = babelfish.Script('Hira')
Requires Python 3.8 or later (supports up to 3.12).
Verify before relying
- Whether the package's dormant maintenance status (827 days since last release) poses a risk for future Python version compatibility or bug fixes.
- Performance characteristics when working with large sets of language/country/script conversions.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — importlib-resources, importlib-metadata |
| Maintenance | dormant — 827 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 133,968/month — #11,492 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: babelfish-0.6.1-py3-none-any.whl
Keywords: language, country, locale
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
isocodesisocodes provides programmatic access to ISO…
permissive · top 15,000 on PyPI
country_listProvides ISO 3166-1 country codes and names in…
permissive · top 15,000 on PyPI
country-converterConverts and matches country names across…
copyleft · top 5,000 on PyPI
pycountryProvides programmatic access to ISO standard…
copyleft · top 1,000 on PyPI
langcodesParses, validates, and standardizes IETF…
permissive · top 5,000 on PyPI
iso3166Converts between ISO 3166-1 country codes…
permissive · top 5,000 on PyPI
countryinfoCountryinfo provides a Python interface to…
permissive · top 15,000 on PyPI
pycountry-convertConverts between ISO country codes (alpha-2,…
permissive · top 15,000 on PyPI
geonamescacheProvides Python dictionaries of geographic data…
permissive · top 5,000 on PyPI
iso-639Provides a Python interface to ISO 639 language…
agpl · top 15,000 on PyPI