skillfed

language-tags

This project is a Python version of the language-tags Javascript project.

language-tags v1.3.1 2.4M downloads/30d#3,095 on PyPI16
Permissive license MIT Active released

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-tags

uv

uv add language-tags

poetry

poetry add language-tags

Installing 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

Development Status :: 5 - Production/StableFramework :: PyramidProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: WSGI :: Application

Tags

language tag validationBCP 47 parserIANA language subtagsRFC 5646 language codeslanguage region script parsing
language-tagsbcp47i18n

More WWW/HTTP packages