This project is a Python version of the language-tags Javascript project.
Project description
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.4.2
Official python 3.5 compatibility
Upgrade to https://github.com/mattcg/language-subtag-registry/releases/tag/v0.3.15
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
ornpm update
)Improvement of the
language-tags.tags.search
function: rank equal description at top. See mattcg/language-tags#4
0.3.2
Upgrade to https://github.com/mattcg/language-subtag-registry/releases/tag/v0.3.11
Added wheel config
Fixed bug under windows: opening data files using utf-8 encoding.
0.3.1
0.3.0
Upgrade to https://github.com/mattcg/language-subtag-registry/releases/tag/v0.3.6
Simplify output of __str__ functions. The previous json dump is assigned to the repr function.
nlbe = tags.tags('nl-Latn-BE') > print(nlbe) 'nl-Latn-BE' > print(nlbe.language) 'nl' > print(nlbe.script) 'Latn'
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
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
Built Distribution
Hashes for language_tags-0.4.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57ee2ae6244ea97fd02bce29eb5c71c9e865dea6acc5cb1b6e8d549c41a9ac2e |
|
MD5 | 9a69d86900109b3e9754b993d2006c5d |
|
BLAKE2b-256 | 42c8c5d28639e83b2c0a2e3603c25fc23817b99e036e16508a863e1edb9e739b |