{ "info": { "author": "Victor Lin", "author_email": "bornstub@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "=========\npycountry\n=========\n\npycountry provides the ISO databases for the standards:\n\n639\n Languages\n\n3166\n Countries\n\n3166-2\n Subdivisions of countries\n\n4217\n Currencies\n\n15924\n Scripts\n\nThe package includes a copy from Debian's `pkg-isocodes` and makes the data\naccessible through a Python API.\n\nTranslation files for the various strings are included as well.\n\n\nCountries (ISO 3166)\n====================\n\nCountries are accessible through a database object that is already configured\nupon import of pycountry and works as an iterable:\n\n >>> import pycountry\n >>> len(pycountry.countries)\n 246\n >>> list(pycountry.countries)[0]\n \n\nSpecific countries can be looked up by their various codes and provide the\ninformation included in the standard as attributes:\n\n >>> germany = pycountry.countries.get(alpha2='DE')\n >>> germany\n \n >>> germany.alpha2\n 'DE'\n >>> germany.alpha3\n 'DEU'\n >>> germany.numeric\n '276'\n >>> germany.name\n 'Germany'\n >>> germany.official_name\n 'Federal Republic of Germany'\n\nNote that historic countries, defined by the ISO 3166-3 sub-standard are not\nincluded in this list.\n\nCountry subdivisions (ISO 3166-2)\n=================================\n\nThe country subdivisions are a little more complex than the countries itself\nbecause they provide a nested and typed structure.\n\nAll subdivisons can be accessed directly:\n\n >>> len(pycountry.subdivisions)\n 4548\n >>> list(pycountry.subdivisions)[0]\n \n\nSubdivisions can be accessed using their unique code and provide at least\ntheir code, name and type:\n\n >>> de_st= pycountry.subdivisions.get(code='DE-ST')\n >>> de_st.code\n 'DE-ST'\n >>> de_st.name\n 'Sachsen-Anhalt'\n >>> de_st.type\n 'State'\n >>> de_st.country\n \n\nSome subdivisions specify another subdivision as a parent:\n\n >>> al_br = pycountry.subdivisions.get(code='AL-BU')\n >>> al_br.code\n 'AL-BU'\n >>> al_br.name\n u'Bulqiz\\xeb'\n >>> al_br.type\n 'District'\n >>> al_br.parent_code\n 'AL-09'\n >>> al_br.parent\n \n >>> al_br.parent.name\n u'Dib\\xebr'\n\nThe divisions of a single country can be queried using the country_code index:\n\n >>> len(pycountry.subdivisions.get(country_code='DE'))\n 16\n\n >>> len(pycountry.subdivisions.get(country_code='US'))\n 57\n\n\nScripts (ISO 15924)\n===================\n\nScripts are available from a database similar to the countries:\n\n >>> len(pycountry.scripts)\n 146\n >>> list(pycountry.scripts)[0]\n \n\n >>> latin = pycountry.scripts.get(name='Latin')\n >>> latin\n \n >>> latin.alpha4\n 'Latn'\n >>> latin.name\n 'Latin'\n >>> latin.numeric\n '215'\n\n\nCurrencies (ISO 4217)\n=====================\n\nThe currencies database is, again, similar to the ones before:\n\n >>> len(pycountry.currencies)\n 182\n >>> list(pycountry.currencies)[0]\n \n\n >>> argentine_peso = pycountry.currencies.get(letter='ARS')\n >>> argentine_peso\n \n >>> argentine_peso.letter\n 'ARS'\n >>> argentine_peso.name\n 'Argentine Peso'\n >>> argentine_peso.numeric\n '032'\n\n\nLanguages (ISO 639)\n===================\n\nThe languages database is similar too:\n\n >>> len(pycountry.languages)\n 486\n >>> list(pycountry.languages)[0]\n \n\n >>> aragonese = pycountry.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\nLocales\n=======\n\nLocales are available in the `pycountry.LOCALES_DIR` subdirectory of this\npackage. The translation domains are called `isoXXX` according to the standard\nthey provide translations for. The directory is structured in a way compatible\nto Python's gettext module.\n\nHere is an example translating language names:\n\n >>> import gettext\n >>> german = gettext.translation('iso3166', pycountry.LOCALES_DIR,\n ... languages=['de'])\n >>> german.install()\n >>> _('Germany')\n 'Deutschland'\n\nTaiwan country name\n===================\n\nThe official name of Taiwan is `Republic of China`, but however, due to the \npressure from Chinese government, ISO defines the name of Taiwan as \n`Province of China`, which is not true after all. Therefore, we replace\n`Province of China` as `Republic of China` in this fork, and it is what this \nfork mainly for. If you don't agree with this modification, please just don't \nuse it.\n\n >>> import gettext\n >>> tw = pycountry.countries.get(alpha2='TW')\n >>> tw.name\n 'Taiwan, Republic of China'\n >>> zh_tw = gettext.translation('iso3166', pycountry.LOCALES_DIR,\n ... languages=['zh_TW'])\n >>> zh_tw.install(unicode=True)\n >>> _('Taiwan, Republic of China')\n u'\\u4e2d\\u83ef\\u6c11\\u570b'\n\nChanges\n=======\n\n0.12.2 (2011-05-19)\n-------------------\n\n- Make lxml an optional dependency\n\n0.12.1.1 (2010-10-19)\n---------------------\n\n- Fix some locales bug\n\n- Add test for Taiwan country name in Readme.txt\n\n- Follow original project to use revision \n 770fa9cd603f90f9fb982b32fe6f45d253f1d33e.\n\n0.12.1 (2010-04-21)\n-------------------\n\n- Remedy brown-bag release 0.12 which was missing all data files due to a bad\n interaction between the build system for the data and zest.releaeser's\n full-release script.\n\n\n0.12 (2010-04-20)\n-----------------\n\n- Follow Debian repository to git.\n\n- Upgrade data to revision 770fa9cd603f90f9fb982b32fe6f45d253f1d33e as\n requested by #5488 and others.\n\n- Reflect subdivision changes with how they reference their parents in the XML\n (they used to use space as a separator but now use a hyphen).\n\n- Refactor index building structures a bit.\n\n- Remove superfluous 'code' index from subdivision database. (Together with\n the data upgrade this also gets rid of all the annoying warnings as\n described in #6667).\n\n- Some light PEP 8 improvements.\n\n0.11 (2009-03-03)\n-----------------\n\n- Updated Debian repository to r1752.\n\n\n0.10 (2008-06-26)\n-----------------\n\n- Added support for country subdivisions (ISO 3166-2). \n\n\n0.9\n---\n\n- Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/victorlin/correct_pycountry", "keywords": "country subdivision language currency iso 3166 639 4217 15924 3166-2", "license": "LGPL 2.1", "maintainer": null, "maintainer_email": null, "name": "correct_pycountry", "package_url": "https://pypi.org/project/correct_pycountry/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/correct_pycountry/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/victorlin/correct_pycountry" }, "release_url": "https://pypi.org/project/correct_pycountry/0.12.2/", "requires_dist": null, "requires_python": null, "summary": "A fork for pycountry, correct the country name of Taiwan", "version": "0.12.2" }, "last_serial": 788461, "releases": { "0.12.1": [ { "comment_text": "", "digests": { "md5": "3704118cb05bc2e537808bd625f57da0", "sha256": "29141ece1c679d362b9c05f08f10eca4a72ddda9a9713eac0a6ed9c33c5a33f1" }, "downloads": -1, "filename": "correct_pycountry-0.12.1.zip", "has_sig": false, "md5_digest": "3704118cb05bc2e537808bd625f57da0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6988464, "upload_time": "2010-10-18T07:33:52", "url": "https://files.pythonhosted.org/packages/b2/6e/ed764ab0f36e8e707abc89698749698640bfadd0792bcb888ab1ce6a31b5/correct_pycountry-0.12.1.zip" } ], "0.12.1.1": [ { "comment_text": "", "digests": { "md5": "3f5a2925a952308924c010fff54b098d", "sha256": "d4fc26df8bfd2bae19f25962e6e722797711ffaf7ad2318f18d236302916d605" }, "downloads": -1, "filename": "correct_pycountry-0.12.1.1.zip", "has_sig": false, "md5_digest": "3f5a2925a952308924c010fff54b098d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6578102, "upload_time": "2010-10-19T10:14:14", "url": "https://files.pythonhosted.org/packages/b6/a5/fa4050821d8350b6a2d119129d3f2423e2573727aa93101c2babc4c32d65/correct_pycountry-0.12.1.1.zip" } ], "0.12.2": [ { "comment_text": "", "digests": { "md5": "20da80413016b95da9cd68a8dbada0ea", "sha256": "e599b685e62ee95c74d1df6341a0d8345cefaf74bb1b7fdcc9c389992c192dc8" }, "downloads": -1, "filename": "correct_pycountry-0.12.2.zip", "has_sig": false, "md5_digest": "20da80413016b95da9cd68a8dbada0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6575543, "upload_time": "2011-05-18T19:00:39", "url": "https://files.pythonhosted.org/packages/1c/31/656e0605828befcfbb58d5436b185d5dd9526fe64e3f93276f74cea027dd/correct_pycountry-0.12.2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "20da80413016b95da9cd68a8dbada0ea", "sha256": "e599b685e62ee95c74d1df6341a0d8345cefaf74bb1b7fdcc9c389992c192dc8" }, "downloads": -1, "filename": "correct_pycountry-0.12.2.zip", "has_sig": false, "md5_digest": "20da80413016b95da9cd68a8dbada0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6575543, "upload_time": "2011-05-18T19:00:39", "url": "https://files.pythonhosted.org/packages/1c/31/656e0605828befcfbb58d5436b185d5dd9526fe64e3f93276f74cea027dd/correct_pycountry-0.12.2.zip" } ] }