Skip to main content

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

Project description

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

Project details


Download files

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

Source Distribution

language_tags-1.3.0.tar.gz (222.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

language_tags-1.3.0-py3-none-any.whl (216.6 kB view details)

Uploaded Python 3

File details

Details for the file language_tags-1.3.0.tar.gz.

File metadata

  • Download URL: language_tags-1.3.0.tar.gz
  • Upload date:
  • Size: 222.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13+

File hashes

Hashes for language_tags-1.3.0.tar.gz
Algorithm Hash digest
SHA256 5a0af805b9f639b0c62b5f76aae324e87c67455e8fd05d63a9a895556aaead86
MD5 4abfbf3d37fd60ab8d709e7d057e440a
BLAKE2b-256 eaae1bc587f173d6ec35dbf26b73001cd589d976c4bab9ce8f07ecb1900f1218

See more details on using hashes here.

File details

Details for the file language_tags-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: language_tags-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 216.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13+

File hashes

Hashes for language_tags-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4ef08ff13960469aa57503f281f110beba71387afd2d17bf363161d42296f19
MD5 5540f6d19648a9caa5165f59022b12a3
BLAKE2b-256 9cd10b16731d61bb2b5456274a2c46bddaf1287f9fc897a3b084ecb534f7eac4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page