This project is a Python version of the language-tags Javascript project.
Project description
IANA Language Tags for Python
_____________________________
.. image:: https://badge.fury.io/py/language_tags.png
:target: http://badge.fury.io/py/language_tags
.. image:: https://travis-ci.org/OnroerendErfgoed/language-tags.png?branch=master
:target: https://travis-ci.org/OnroerendErfgoed/language-tags
.. image:: https://coveralls.io/repos/OnroerendErfgoed/language-tags/badge.png
:target: https://coveralls.io/r/OnroerendErfgoed/language-tags
.. image:: https://readthedocs.org/projects/language-tags/badge/?version=latest
:target: https://readthedocs.org/projects/language-tags/?badge=latest
This Python API offers a way to validate and lookup languages tags.
Standard
________
It is based on `BCP 47 <http://tools.ietf.org/html/bcp47>`_ (`RFC 5646 <http://tools.ietf.org/html/rfc5646>`_) and the latest `IANA language subtag registry <http://www.iana.org/assignments/language-subtag-registry>`_.
This project will be updated as the standards change.
JSON data
_________
See the `language-subtag-registry <https://github.com/mattcg/language-subtag-registry>`_ project for the underlying JSON data.
Javascript version
__________________
This project is a Python version of the `language-tags <https://github.com/mattcg/language-tags>`_ Javascript project.
0.2.0
_____
- Adjust language, region and script properties of Tag. The properties will return Subtag class instead of a list of string subtags.
.. code-block:: python
> 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.
.. code-block:: python
> print(tags.tag('nl-BE'))
'{"tag": "nl-be"}'
- Added functions to easily select either the language, region or script subtags strings of a Tag.
.. code-block:: python
> print(tags.tag('nl-BE').language)
['nl']
0.1.0
_____
- Initial version
_____________________________
.. image:: https://badge.fury.io/py/language_tags.png
:target: http://badge.fury.io/py/language_tags
.. image:: https://travis-ci.org/OnroerendErfgoed/language-tags.png?branch=master
:target: https://travis-ci.org/OnroerendErfgoed/language-tags
.. image:: https://coveralls.io/repos/OnroerendErfgoed/language-tags/badge.png
:target: https://coveralls.io/r/OnroerendErfgoed/language-tags
.. image:: https://readthedocs.org/projects/language-tags/badge/?version=latest
:target: https://readthedocs.org/projects/language-tags/?badge=latest
This Python API offers a way to validate and lookup languages tags.
Standard
________
It is based on `BCP 47 <http://tools.ietf.org/html/bcp47>`_ (`RFC 5646 <http://tools.ietf.org/html/rfc5646>`_) and the latest `IANA language subtag registry <http://www.iana.org/assignments/language-subtag-registry>`_.
This project will be updated as the standards change.
JSON data
_________
See the `language-subtag-registry <https://github.com/mattcg/language-subtag-registry>`_ project for the underlying JSON data.
Javascript version
__________________
This project is a Python version of the `language-tags <https://github.com/mattcg/language-tags>`_ Javascript project.
0.2.0
_____
- Adjust language, region and script properties of Tag. The properties will return Subtag class instead of a list of string subtags.
.. code-block:: python
> 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.
.. code-block:: python
> print(tags.tag('nl-BE'))
'{"tag": "nl-be"}'
- Added functions to easily select either the language, region or script subtags strings of a Tag.
.. code-block:: python
> print(tags.tag('nl-BE').language)
['nl']
0.1.0
_____
- Initial version
Project details
Release history Release notifications | RSS feed
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.2.0.tar.gz
(195.5 kB
view hashes)