{ "info": { "author": "Oliver Wilkerson", "author_email": "oliver.wilkerson@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "License :: Other/Proprietary License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# GEONAMESZIP\nA quick and dirty script/api for syncing postal codes / zip codes with a local sqlite3 database.\n\n### Why?\nPersonally I dislike hitting up a remote server for mostly static information.\nSince GeoNames provides this data under a Creative Commons license, this script\npulls all countries and drops it in a sqlite3 for (relatively) fast lookup.\n\n## Important!\nThis data is provided by GeoNames under the Creative Commons license (http://creativecommons.org/licenses/by/3.0/).\nIf you use this data, you must provide credit to them whenever it is used.\n\nThe python-geonameszip library itself is under the MIT license.\n\n### Example:\n\nMain uses are for postal code validation:\n\n```python\nimport geonameszip\n# NOTE: country is required due to duplicate zip codes based on country.\nus_result = geonameszip.lookup_postal_code('77098', 'US')\nprint(us_result)\n# {'city': u'Houston', 'country': u'US', 'lon': -95.4118, 'county': u'Harris', 'state': u'Texas', 'postal_code': u'77098', 'lat': 29.735, 'state_abbreviation': u'TX'}\nmx_result = geonameszip.lookup_postal_code('77098', 'MX')\nprint(mx_result)\n# {'city': u'Barrio Bravo', 'country': u'MX', 'lon': -88.6458, 'county': u'Othon P Blanco', 'state': u'Quintana Roo', 'postal_code': u'77098', 'lat': 19.4083, 'state_abbreviation': u'ROO'}\n```\n\n\n## API\n\n`geonameszip`\n\n```python\nimport_from_file(source_path)\n```\n- Drops the postal_codes table in the sqlite3 database\n- Re-creates the tabl.e\n- Inserts all the data provided by a file formatted like `allCountries.txt`.\n\n```python\nlookup_postal_code(postal_code, country, conn=None, cursor=None)\n```\n- Selects the first available option for the `postal_code`, `country` combination.\n- NOTE: Currently, if multiple entries match, only the top-most is provided.\n\n```python\nupdate_postal_code(postal_code, country, city, state, state_abbreviation, county, lat, lon, conn=None,commit=True, cursor=None)\n```\n- _Inserts_ the values provided in the arguments into the database.\n- NOTE: This always _inserts_ the data, never updates. The data isn't consistently unique and the database has no primary key so it isn't easy to provide a way to update a single row.\n- This can create duplicate entries.\n\n\nFor python-geonameszip (this python code ONLY -- not the data):\nThe MIT License\n===============\n\nCopyright (c) 2009 Anton Grigoryev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n\n# GEONAMES Data:\n\nCreative Commons Deed\n=====================\n_Licensees may copy, distribute, display and perform the work and make derivative works based on it only if they give the author or licensor the credits in the manner specified by [http://creativecommons.org/licenses/by/3.0/](http://creativecommons.org/licenses/by/3.0/)._\n\n## Summary\n_This is a human-readable summary of (and not a substitute for) the [license](http://creativecommons.org/licenses/by/3.0/)._ \n\n\n### You are free to:\n- *Share* \u00e2\u20ac\u201d copy and redistribute the material in any medium or format\n- *Adapt* \u00e2\u20ac\u201d remix, transform, and build upon the material\n - for any purpose, even commercially.\n - The licensor cannot revoke these freedoms as long as you follow the license terms.\n\n\n### Under the following terms:\n- *Attribution* \u00e2\u20ac\u201d You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.\n- *No additional restrictions* \u00e2\u20ac\u201d You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.\n\n\n### Notices:\n\nYou do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.\nNo warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/oliverseal/python-geonameszip", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "geonameszip", "package_url": "https://pypi.org/project/geonameszip/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/geonameszip/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/oliverseal/python-geonameszip" }, "release_url": "https://pypi.org/project/geonameszip/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "Quick and dirty script/api for syncing postal codes / zip codes with a local sqlite3 database.", "version": "0.3.0" }, "last_serial": 1495940, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2924df9a0effb774e8980fd253911ace", "sha256": "db7be685fb34447d2454148dd52a29b382ab37f77f8d922e4f021590e38cb429" }, "downloads": -1, "filename": "geonameszip-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2924df9a0effb774e8980fd253911ace", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7414, "upload_time": "2013-12-15T16:52:23", "url": "https://files.pythonhosted.org/packages/16/65/dacd11d7d2ea5a999347a162376358c9c37a58bfc79473106a2d52b154dd/geonameszip-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "4bff5e9d07a14a8ed2371e555604e2ed", "sha256": "8a727dd3967a3e8cb296702168785cf992de7d00c0b8c235be497deb9b7c739b" }, "downloads": -1, "filename": "geonameszip-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4bff5e9d07a14a8ed2371e555604e2ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7481, "upload_time": "2013-12-16T02:47:39", "url": "https://files.pythonhosted.org/packages/f0/4b/de64d16e8a447e38dffdadeca92b76e2a09039ea5bd8caf80f412f66284c/geonameszip-0.1.1.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "57abe8b2d408fbff36e9ca6ed6775675", "sha256": "a3eecd2dd8b80f4fc0b14cba2c1a4f11209a44ce058e2ab44c303cf35bb6959b" }, "downloads": -1, "filename": "geonameszip-0.1.3.tar.gz", "has_sig": false, "md5_digest": "57abe8b2d408fbff36e9ca6ed6775675", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7729, "upload_time": "2013-12-16T04:19:39", "url": "https://files.pythonhosted.org/packages/35/e0/9cc14c97b68e4760f03267c734a4bc03d7dafaa6fd57aaa9eb739e1f48d7/geonameszip-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "3dbedfa609c6cb0b3b91d750dc30d009", "sha256": "af7ca0b23e1ff65e6c46aac381f911c7e2be55f6abf81d888a4b8d38b79aea5c" }, "downloads": -1, "filename": "geonameszip-0.1.4.tar.gz", "has_sig": false, "md5_digest": "3dbedfa609c6cb0b3b91d750dc30d009", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7714, "upload_time": "2014-07-16T05:39:17", "url": "https://files.pythonhosted.org/packages/cf/06/667ac47a7138fc128447c0f50b268168b0232e8b47365abb620d6a12916c/geonameszip-0.1.4.tar.gz" } ], "0.2.0": [ { "comment_text": "built for Linux-3.13.0-32-generic-x86_64-with-glibc2.9", "digests": { "md5": "4cbbd601fe7ab694b6bbb49fd29f5e54", "sha256": "371919fbb2c0db4a90cae8f53bb23b9ba2948ffa4640cc97e8543098a8954509" }, "downloads": -1, "filename": "geonameszip-0.2.0.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "4cbbd601fe7ab694b6bbb49fd29f5e54", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 11757, "upload_time": "2014-07-25T04:24:34", "url": "https://files.pythonhosted.org/packages/08/51/f096a59f04c902d8cab51e8e4112f9e91c59687e969ca914a05da1536456/geonameszip-0.2.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "fb6812d6dbb10af5350bcf2e63d69d34", "sha256": "833d270f9fd7d3981ed2ec87f67fedbf4dad8bf28e548f447f55b2264d102ece" }, "downloads": -1, "filename": "geonameszip-0.2.0.tar.gz", "has_sig": false, "md5_digest": "fb6812d6dbb10af5350bcf2e63d69d34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7853, "upload_time": "2014-07-25T04:24:23", "url": "https://files.pythonhosted.org/packages/9a/16/7e8431a8f68b6c1536b16de0982470d6b13f6bcdd69206a580c8e0fb1e81/geonameszip-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "389be78c765e0925a8f9dc8137ed5eab", "sha256": "df2f9cceb67d9d2a95d6e9e22f93f94a7c7ccac5c97f8941aedc222bc6eed316" }, "downloads": -1, "filename": "geonameszip-0.2.1.zip", "has_sig": false, "md5_digest": "389be78c765e0925a8f9dc8137ed5eab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15252, "upload_time": "2015-04-08T13:50:55", "url": "https://files.pythonhosted.org/packages/62/b4/b458924a847356b24bc06e2506871c397e8853fda7698089a568030a7fbc/geonameszip-0.2.1.zip" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "e193175418341a087c2c6e0c9d9babcf", "sha256": "db2d6e20c40ceb2c3ee6d1369c3ed8154c1ad96b684f134ec9ba83a6e91e5d4d" }, "downloads": -1, "filename": "geonameszip-0.2.2.zip", "has_sig": false, "md5_digest": "e193175418341a087c2c6e0c9d9babcf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15262, "upload_time": "2015-04-08T14:49:06", "url": "https://files.pythonhosted.org/packages/37/05/a83e1c549d28ffdd9f56f829a7e963052666b6db9741c9033b5b7d2722b7/geonameszip-0.2.2.zip" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "6ff7144311c6cb66378f0652b2a22f97", "sha256": "3d7263a7e544712061736398e4565ce51a7362ff629dc13e128f82f4370ca344" }, "downloads": -1, "filename": "geonameszip-0.2.3.zip", "has_sig": false, "md5_digest": "6ff7144311c6cb66378f0652b2a22f97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15262, "upload_time": "2015-04-08T14:50:30", "url": "https://files.pythonhosted.org/packages/b7/87/7643fc7070fc7455debaf54c1c8f7be3d9b308dec3da2e1d9f97e84b5d81/geonameszip-0.2.3.zip" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "0ff59eb1faaf058f560de6c19b9073c1", "sha256": "82f591e1c30e771c9313989e8158bf1d874ab31f58e8c693c42a844867ebb26b" }, "downloads": -1, "filename": "geonameszip-0.2.4.zip", "has_sig": false, "md5_digest": "0ff59eb1faaf058f560de6c19b9073c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15262, "upload_time": "2015-04-08T14:51:52", "url": "https://files.pythonhosted.org/packages/94/05/d52adb2608542b2f8febab9d992c79d6ed7eb340616fe40c34e73f560355/geonameszip-0.2.4.zip" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "d7cbab94c4377fac5c7caf09d721da77", "sha256": "609c291426439d998478a15d56574bef6ceb30ffb7889d449477f2d1862c8c82" }, "downloads": -1, "filename": "geonameszip-0.3.0.zip", "has_sig": false, "md5_digest": "d7cbab94c4377fac5c7caf09d721da77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15263, "upload_time": "2015-04-08T15:02:25", "url": "https://files.pythonhosted.org/packages/d5/57/61084610378b8312f2f3628cddf1cc2b8a4f714698d7e01f098da38e1c5f/geonameszip-0.3.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d7cbab94c4377fac5c7caf09d721da77", "sha256": "609c291426439d998478a15d56574bef6ceb30ffb7889d449477f2d1862c8c82" }, "downloads": -1, "filename": "geonameszip-0.3.0.zip", "has_sig": false, "md5_digest": "d7cbab94c4377fac5c7caf09d721da77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15263, "upload_time": "2015-04-08T15:02:25", "url": "https://files.pythonhosted.org/packages/d5/57/61084610378b8312f2f3628cddf1cc2b8a4f714698d7e01f098da38e1c5f/geonameszip-0.3.0.zip" } ] }