Skip to main content

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

Project description

IANA Language Tags for Python

https://badge.fury.io/py/language_tags.png https://travis-ci.org/OnroerendErfgoed/language-tags.png?branch=master 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.

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.

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-0.3.2.tar.gz (197.6 kB view hashes)

Uploaded Source

Built Distribution

language_tags-0.3.2-py2.py3-none-any.whl (205.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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