language-tags
This project is a Python version of the language-tags Javascript project.
What it is and what it does
language-tags is a Python library for working with IANA language tags as defined by BCP 47 and RFC 5646. It provides validation and parsing of language tags (like 'en-US' or 'nl-Latn-BE') and lets you query the IANA language subtag registry to look up descriptions and metadata for each component. The package wraps the official IANA language subtag registry in JSON form and exposes it through a simple API.
You use it when you need to validate that a language tag conforms to the standard, extract its parts (language code, script, region), or look up what a particular subtag means. It has no external runtime dependencies and is actively maintained to track changes in the IANA registry.
Use it for:
- Validate user-supplied language preferences in a web application before storing or processing them.
- Parse a language tag like 'zh-Hans-CN' to extract the language, script, and region for localization logic.
- Look up the description of a language subtag (e.g., what 'Latn' means) from the IANA registry.
- Build a language selector UI that accepts only valid BCP 47 tags and rejects malformed input.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Validates and parses IANA language tags according to BCP 47 (RFC 5646) standards, allowing you to check whether a language tag is valid and extract its language, script, and region components.
Yes. This is a stable, actively maintained library with no dependencies, a permissive MIT license, and low install friction. Install it if you need to validate or parse IANA language tags in your application. The only constraint is a Python 3.10+ requirement.
Install
language-tags on PyPI
pip
pip install language-tagsuv
uv add language-tagspoetry
poetry add language-tagsInstalling language-tags
Before you install
Low install friction; pure Python wheel with no runtime dependencies. Actively maintained with recent updates for Python 3.13 and 3.14 support.
License in practice
MIT license is permissive; you can use this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install language-tags
import language_tags
tag = language_tags.tags.tag('en-US')
print(tag.language) # Subtag object for 'en'
print(tag.region) # Subtag object for 'US'
Requires Python 3.10 or later (3.10–3.14 supported).
Verify before relying
- Whether the IANA registry data is automatically updated or requires manual package releases to stay current.
- Performance characteristics when validating large batches of language tags.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 98 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,383,060/month — #3,095 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: language_tags-1.3.1-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
langcodesParses, validates, and standardizes IETF…
permissive · top 5,000 on PyPI
tldsProvides a set of valid top-level domains…
permissive · top 15,000 on PyPI
fqdnValidates fully-qualified domain names (FQDNs)…
copyleft · top 1,000 on PyPI
rfc3987Provides RFC 3986 and RFC 3987 compliant…
copyleft · top 5,000 on PyPI
iregexp-checkValidates regular expressions against RFC 9485…
permissive · top 15,000 on PyPI
emvalValidates email addresses according to RFC 5322…
permissive · top 15,000 on PyPI
pycountryProvides programmatic access to ISO standard…
copyleft · top 1,000 on PyPI
whoisRetrieves WHOIS information for domain names by…
permissive · top 15,000 on PyPI
google-i18n-addressValidates, normalizes, and formats postal…
permissive · top 15,000 on PyPI
unpaddedbase64Encodes and decodes Base64 data without RFC…
permissive · top 5,000 on PyPI