Status
------
|master_status| |dev_status| |pypi_month| |pypi_version| |gh_forks| |gh_stars|
License
-------
GNU Affero General Public License version 3 (AGPLv3)
Supports
--------
- ISO 639-1
- ISO 639-2
- ISO 639-3
- ISO 639-5
Breaking changes
----------------
- 0.4.4: ``retired`` has been changed to { 'code': (``datetime``, [``_Language``, ...], 'description') }.
- 0.4.0: ``alpha3`` has been renamed to ``part3``. ``languages.alpha3`` might be used as an aggregation of all 'three letter codes' in the future.
Compatibility
-------------
This library is aimed to be **fully compatible** with ``pycountry.languages`` v1.11 and before. In v1.12 they broke their own API and this library will **not support** the new API.
It provides the following attribute abstractions:
- ``terminology`` -> ``part2t``
- ``bibliographic`` -> ``part2b``
- ``alpha2`` -> ``part1``
If you have no intentions on using ``pycountry.languages`` or want/need to keep compatibility then please use the ``partX`` attributes for brevity and clarity.
Usage
-----
As taken from ``pycountry.languages`` v1.11 documentation, with modifications and further additions.
.. code-block:: python
>>> from iso639 import languages
>>> from pprint import pprint
>>> len(languages)
7981
>>> type(list(languages)[0])
<class 'iso639.iso639._Language'>
# Compatibility
>>> aragonese = languages.get(alpha2='an')
>>> aragonese.alpha2
'an'
>>> aragonese.bibliographic
'arg'
>>> aragonese.terminology
'arg'
>>> aragonese.name
'Aragonese'
>>> bengali = languages.get(alpha2='bn')
>>> bengali.name
'Bengali'
# We *do not* deviate from the standard
>>> try:
... bengali.common_name
... except AttributeError as e:
... print(e)
'_Language' object has no attribute 'common_name'
# New API
>>> aragonese = languages.get(part1='an')
>>> aragonese.part1
'an'
>>> aragonese.part2b
'arg'
>>> aragonese.part2t
'arg'
>>> aragonese.part3
'arg'
>>> aragonese.name
'Aragonese'
>>> aragonese.inverted
'Aragonese'
>>> pprint(vars(aragonese))
{'inverted': 'Aragonese',
'macro': '',
'name': 'Aragonese',
'names': [],
'part1': 'an',
'part2b': 'arg',
'part2t': 'arg',
'part3': 'arg',
'part5': ''}
>>> sanapana = languages.get(retired='sap')
>>> [type(elem).__name__ for elem in sanapana]
['datetime', 'list', 'str']
>>> [lang.part3 for lang in sanapana[1]]
['spn', 'aqt']
Contains external data
----------------------
- `ISO 639-1`_, on 2014-11-28
- `ISO 639-2`_, on 2014-11-28
- `ISO 639-3 Code Set`_, dated 2015-05-05
- `ISO 639-3 Language Names Index`_, dated 2015-05-05
- `ISO 639-3 Macrolanguage Mappings`_, dated 2015-05-05
- `ISO 639-3 Retired Code Element Mappings`_, dated 2015-05-05
- `ISO 639-5`_, dated 2011-05-12
.. _ISO 639-1: http://id.loc.gov/vocabulary/iso639-1.tsv
.. _ISO 639-2: http://id.loc.gov/vocabulary/iso639-2.tsv
.. _ISO 639-3 Code Set: http://www-01.sil.org/iso639-3/iso-639-3.tab
.. _ISO 639-3 Language Names Index: http://www-01.sil.org/iso639-3/iso-639-3_Name_Index.tab
.. _ISO 639-3 Macrolanguage Mappings: http://www-01.sil.org/iso639-3/iso-639-3-macrolanguages.tab
.. _ISO 639-3 Retired Code Element Mappings: http://www-01.sil.org/iso639-3/iso-639-3_Retirements.tab
.. _ISO 639-5: http://id.loc.gov/vocabulary/iso639-5.tsv
.. |master_status| image:: https://travis-ci.org/noumar/iso639.svg?branch=master
:target: https://travis-ci.org/noumar/iso639/branches
:alt: master
.. |dev_status| image:: https://travis-ci.org/noumar/iso639.svg?branch=development
:target: https://travis-ci.org/noumar/iso639/branches
:alt: development
.. |pypi_month| image:: https://img.shields.io/pypi/dm/iso-639.svg
:target: https://pypi.python.org/pypi/iso-639
:alt: downloads/month
.. |pypi_version| image:: https://img.shields.io/pypi/v/iso-639.svg
:target: https://pypi.python.org/pypi/iso-639
:alt: latest version
.. |gh_forks| image:: https://img.shields.io/github/forks/noumar/iso639.svg
:target: https://github.com/noumar/iso639/network
:alt: gh forks
.. |gh_stars| image:: https://img.shields.io/github/stars/noumar/iso639.svg
:target: https://github.com/noumar/iso639/stargazers
:alt: gh stars
Raw data
{
"_id": null,
"home_page": "https://github.com/noumar/iso639",
"name": "iso-639",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pycountry languages iso-639 iso 639 639-1 639-2 639-3 639-5",
"author": "Mikael Karlsson",
"author_email": "i8myshoes@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/5a/8d/27969852f4e664525c3d070e44b2b719bc195f4d18c311c52e57bb93614e/iso-639-0.4.5.tar.gz",
"platform": "UNKNOWN",
"description": "Status\n------\n\n|master_status| |dev_status| |pypi_month| |pypi_version| |gh_forks| |gh_stars|\n\nLicense\n-------\n\nGNU Affero General Public License version 3 (AGPLv3)\n\nSupports\n--------\n\n- ISO 639-1\n- ISO 639-2\n- ISO 639-3\n- ISO 639-5\n\nBreaking changes\n----------------\n\n- 0.4.4: ``retired`` has been changed to { 'code': (``datetime``, [``_Language``, ...], 'description') }.\n- 0.4.0: ``alpha3`` has been renamed to ``part3``. ``languages.alpha3`` might be used as an aggregation of all 'three letter codes' in the future.\n\nCompatibility\n-------------\n\nThis library is aimed to be **fully compatible** with ``pycountry.languages`` v1.11 and before. In v1.12 they broke their own API and this library will **not support** the new API.\n\nIt provides the following attribute abstractions:\n\n- ``terminology`` -> ``part2t``\n- ``bibliographic`` -> ``part2b``\n- ``alpha2`` -> ``part1``\n\nIf you have no intentions on using ``pycountry.languages`` or want/need to keep compatibility then please use the ``partX`` attributes for brevity and clarity.\n\nUsage\n-----\n\nAs taken from ``pycountry.languages`` v1.11 documentation, with modifications and further additions.\n\n.. code-block:: python\n\n >>> from iso639 import languages\n >>> from pprint import pprint\n\n >>> len(languages)\n 7981\n\n >>> type(list(languages)[0])\n <class 'iso639.iso639._Language'>\n\n # Compatibility\n >>> aragonese = languages.get(alpha2='an')\n >>> aragonese.alpha2\n 'an'\n >>> aragonese.bibliographic\n 'arg'\n >>> aragonese.terminology\n 'arg'\n >>> aragonese.name\n 'Aragonese'\n\n >>> bengali = languages.get(alpha2='bn')\n >>> bengali.name\n 'Bengali'\n\n # We *do not* deviate from the standard\n >>> try:\n ... bengali.common_name\n ... except AttributeError as e:\n ... print(e)\n '_Language' object has no attribute 'common_name'\n\n # New API\n >>> aragonese = languages.get(part1='an')\n >>> aragonese.part1\n 'an'\n >>> aragonese.part2b\n 'arg'\n >>> aragonese.part2t\n 'arg'\n >>> aragonese.part3\n 'arg'\n >>> aragonese.name\n 'Aragonese'\n >>> aragonese.inverted\n 'Aragonese'\n >>> pprint(vars(aragonese))\n {'inverted': 'Aragonese',\n 'macro': '',\n 'name': 'Aragonese',\n 'names': [],\n 'part1': 'an',\n 'part2b': 'arg',\n 'part2t': 'arg',\n 'part3': 'arg',\n 'part5': ''}\n >>> sanapana = languages.get(retired='sap')\n >>> [type(elem).__name__ for elem in sanapana]\n ['datetime', 'list', 'str']\n >>> [lang.part3 for lang in sanapana[1]]\n ['spn', 'aqt']\n\nContains external data\n----------------------\n\n- `ISO 639-1`_, on 2014-11-28\n- `ISO 639-2`_, on 2014-11-28\n- `ISO 639-3 Code Set`_, dated 2015-05-05\n- `ISO 639-3 Language Names Index`_, dated 2015-05-05\n- `ISO 639-3 Macrolanguage Mappings`_, dated 2015-05-05\n- `ISO 639-3 Retired Code Element Mappings`_, dated 2015-05-05\n- `ISO 639-5`_, dated 2011-05-12\n\n.. _ISO 639-1: http://id.loc.gov/vocabulary/iso639-1.tsv\n.. _ISO 639-2: http://id.loc.gov/vocabulary/iso639-2.tsv\n.. _ISO 639-3 Code Set: http://www-01.sil.org/iso639-3/iso-639-3.tab\n.. _ISO 639-3 Language Names Index: http://www-01.sil.org/iso639-3/iso-639-3_Name_Index.tab\n.. _ISO 639-3 Macrolanguage Mappings: http://www-01.sil.org/iso639-3/iso-639-3-macrolanguages.tab\n.. _ISO 639-3 Retired Code Element Mappings: http://www-01.sil.org/iso639-3/iso-639-3_Retirements.tab\n.. _ISO 639-5: http://id.loc.gov/vocabulary/iso639-5.tsv\n\n.. |master_status| image:: https://travis-ci.org/noumar/iso639.svg?branch=master\n :target: https://travis-ci.org/noumar/iso639/branches\n :alt: master\n.. |dev_status| image:: https://travis-ci.org/noumar/iso639.svg?branch=development\n :target: https://travis-ci.org/noumar/iso639/branches\n :alt: development\n.. |pypi_month| image:: https://img.shields.io/pypi/dm/iso-639.svg\n :target: https://pypi.python.org/pypi/iso-639\n :alt: downloads/month\n.. |pypi_version| image:: https://img.shields.io/pypi/v/iso-639.svg\n :target: https://pypi.python.org/pypi/iso-639\n :alt: latest version\n.. |gh_forks| image:: https://img.shields.io/github/forks/noumar/iso639.svg\n :target: https://github.com/noumar/iso639/network\n :alt: gh forks\n.. |gh_stars| image:: https://img.shields.io/github/stars/noumar/iso639.svg\n :target: https://github.com/noumar/iso639/stargazers\n :alt: gh stars",
"bugtrack_url": null,
"license": "AGPLv3",
"summary": "Python library for ISO 639 standard",
"version": "0.4.5",
"split_keywords": [
"pycountry",
"languages",
"iso-639",
"iso",
"639",
"639-1",
"639-2",
"639-3",
"639-5"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "cc282daf57f57061a9309f2567bff052",
"sha256": "dc9cd4b880b898d774c47fe9775167404af8a85dd889d58f9008035109acce49"
},
"downloads": -1,
"filename": "iso-639-0.4.5.tar.gz",
"has_sig": false,
"md5_digest": "cc282daf57f57061a9309f2567bff052",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 167421,
"upload_time": "2016-04-29T14:57:29",
"upload_time_iso_8601": "2016-04-29T14:57:29.657544Z",
"url": "https://files.pythonhosted.org/packages/5a/8d/27969852f4e664525c3d070e44b2b719bc195f4d18c311c52e57bb93614e/iso-639-0.4.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2016-04-29 14:57:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "noumar",
"github_project": "iso639",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "iso-639"
}