Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

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

Project description

# IANA Language Tags for Python #

[![Pypi package](]( [![Build Status](]( [![Coverage Status](]( [![Documentation Status](](

Based on [BCP 47]( ([RFC 5646]( and the latest [IANA language subtag registry](

This project will be updated as the standards change.

Language-tags 1.0.0 and onward will only supports Python 3, for Python 2 support, please use language-tags 0.5.0.

## JSON data ##

See the [language-subtag-registry]( project for the underlying JSON data.

## Javascript version ##

This project is a Python version of the [language-tags]( Javascript project. /n/nChangelog =========


  • Drop support for Python 2


  • Updated dependencies and Python (Removed Python3.3 and Python3.4 support, added 3.6 and 3.7)


  • Avoid modifying tag when getting description


  • Close files after opening #38


  • Bug fix release: language tag ‘aa’ is detected as invalid #27



  • Included the data folder again in the project package.
  • Added bash script ( to download the language-subtag-registry and move this data in the data folder of the project.


  • Allow parsing a redundant tag into subtags.
  • Added package.json file for easy update of the language subtag registry data using npm (npm install or npm update)
  • Improvement of the function: rank equal description at top. See mattcg/language-tags#4




  • Adjust language, region and script properties of Tag. The properties will return language_tags.Subtag.Subtag instead of a list of string subtags

    > print(tags.tag('nl-BE').language)
    '{"subtag": "nl", "record": {"Subtag": "nl", "Suppress-Script": "Latn", "Added": "2005-10-16", "Type": "language", "Description": ["Dutch", "Flemish"]}, "type": "language"}'
    > print(tags.tag('nl-BE').region)
    '{"subtag": "be", "record": {"Subtag": "BE", "Added": "2005-10-16", "Type": "region", "Description": ["Belgium"]}, "type": "region"}'
    > print(tags.tag('en-mt-arab').script)
    '{"subtag": "arab", "record": {"Subtag": "Arab", "Added": "2005-10-16", "Type": "script", "Description": ["Arabic"]}, "type": "script"}'


  • Added string and Unicode functions to make it easy to print Tags and Subtags.

    > print(tags.tag('nl-BE'))
    '{"tag": "nl-be"}'
  • Added functions to easily select either the language, region or script subtags strings of a Tag.

    > print(tags.tag('nl-BE').language)


  • Initial version

Project details

Download files

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

Files for language-tags, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size language_tags-1.0.0.tar.gz (203.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page