Skip to main content

IANA Language Tags for Python

https://badge.fury.io/py/language-tags.png https://app.travis-ci.com/OnroerendErfgoed/language-tags.png?branch=develop https://coveralls.io/repos/OnroerendErfgoed/language-tags/badge.png https://readthedocs.org/projects/language-tags/badge/?version=latest

This Python API offers a way to validate and lookup languages tags.

Standard

It is 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 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. Changelog =========

1.3.2

  • Add support for python 3.15 (#103)

  • Update dependencies (#105)

1.3.1

  • Add python 3.13 and python 3.14 support (#100)

1.3.0

  • Migrate to latest data #97

  • Pyproject and GitHub Actions (#92)

  • Add test-coverage (#96)

1.2.0

  • Update data to version 2022-06-28 (#89)

  • Drop support for Python 3.6 and 3.7 and add support for Python 3.10 (#87)

  • Drop universal wheels

  • Drop tox support

1.1.0

  • Update data to version 2020-09-29 (#62)

  • Update dependencies and Python (Removed Python 3.5 support, now supports 3.6 to 3.9) (#74, #77)

  • Drop pyup support (#80)

  • Fix pypi description (#78)

  • Include MIT License in package (#67)

  • Fix deprecation warnings (#84)

1.0.0

  • Drop support for Python 2

0.5.0

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

0.4.6

  • Avoid modifying tag when getting description

0.4.5

  • Close files after opening #38

0.4.4

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

0.4.3

0.4.2

0.4.1

  • Included the data folder again in the project package.

  • Added bash script (update_data_files.sh) to download the language-subtag-registry and move this data in the data folder of the project.

0.4.0

  • 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 language-tags.tags.search function: rank equal description at top. See mattcg/language-tags#4

0.3.2

0.3.1

0.3.0

0.2.0

  • 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"}'

0.1.1

  • 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)
    ['nl']

0.1.0

  • Initial version

Metadata

Release files for language-tags 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for language-tags 1.3.2
File Size Uploaded Provenance
language_tags-1.3.2.tar.gz 222.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for language-tags 1.3.2
File Interpreter ABI Platform
language_tags-1.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 439.6 kB

Release files / language_tags-1.3.2.tar.gz

Download URL language_tags-1.3.2.tar.gz
Size 222.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fdce91ca2f770710853b3f413205042225e8e64108e6fdb101677d32bab11814
BLAKE2b-256 checksum
How to use checksums
61ef8deeb6524134911f5cddcf772cc938a1f890e9d36e45cb2ee004d9c1805b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15+

Release files / language_tags-1.3.2-py3-none-any.whl

Download URL language_tags-1.3.2-py3-none-any.whl
Size 216.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4feb5034ae57205b80e6dbfbe5efebe03e5f07278579bf9510a05968a377453
BLAKE2b-256 checksum
How to use checksums
4b811c6903907562e8cccc53971d8c49befbe4a146b8e2a333980bba22a5f15e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15+

Security for language-tags 1.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page