{ "info": { "author": "Nathan Reynolds", "author_email": "email@nreynolds.co.uk", "bugtrack_url": null, "classifiers": [], "description": "oscodepoint.py\n==============\n\nAn interface to Ordnance Survey's CodePoint-Open. CodePoint-Open is a free\ndataset that maps UK postcodes to coordinates.\n\n`oscodepoint` reads in this data, whether in the original zip or decompressed,\nparses the data, and converts grid references to latitude and longitude.\n\nThe dataset can be downloaded from\nhttp://www.ordnancesurvey.co.uk/oswebsite/products/code-point-open/\n\n\nExample:\n--------\n >>> from oscodepoint import open_codepoint\n >>> codepoint = open_codepoint('codepo_gb.zip')\n >>> for entry in codepoint.entries():\n ... print entry['Postcode'], entry['Latitude'], entry['Longitude']\n ... break # Over 1.6 million rows\n AB101AA 57.1482995075 -2.09663094048\n\n\nToo much data? Try limiting the postcode areas:\n-----------------------------------------------\n >>> from oscodepoint import open_codepoint\n >>> codepoint = open_codepoint('codepo_gb.zip')\n >>> for entry in codepoint.entries(areas=['NR', 'IP']):\n ... print entry['Postcode'], entry['Eastings'], entry['Northings']\n ... break\n NR1 1AA 624068 308352\n\n\nWant the postcode's county?\n---------------------------\nPostcode entries have a `Admin_country_code` field. `Doc/Codelist.xls` maps\nthese codes to county names, and `codepoint.codelist` can be used to access\nthis file. For example:\n\n >>> from oscodepoint import open_codepoint\n >>> codepoint = open_codepoint('codepo_gb.zip')\n >>> county_list = codepoint.codelist['County']\n >>> for entry in codepoint.entries(areas=['NR']):\n ... print entry['Postcode'], entry['Latitude'], entry['Longitude'], county_list.get(entry['Admin_county_code'])\n ... break\n NR1 1AA 52.6266175146 1.30932087485 Norfolk County\n\n\nGet the total number of postcodes for your progress bar:\n--------------------------------------------------------\n >>> from oscodepoint import open_codepoint\n >>> codepoint = open_codepoint('codepo_gb.zip')\n >>> print codepoint.metadata['area_counts']['NR']\n 22730\n >>> print codepoint.metadata['total_count']\n 1692241", "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/nathforge/oscodepoint", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "oscodepoint", "package_url": "https://pypi.org/project/oscodepoint/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/oscodepoint/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/nathforge/oscodepoint" }, "release_url": "https://pypi.org/project/oscodepoint/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "A Python interface to Ordnance Survey's CodePoint-Open data", "version": "0.2.1" }, "last_serial": 1043590, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "965ba8403ff7c700bddef223322f6da9", "sha256": "4d37fef29f37368430cad74e7e4f58f7900e6486e9f56491e8e47cc6824ef360" }, "downloads": -1, "filename": "oscodepoint-0.1.tar.gz", "has_sig": false, "md5_digest": "965ba8403ff7c700bddef223322f6da9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3672, "upload_time": "2012-02-07T17:27:31", "url": "https://files.pythonhosted.org/packages/1a/08/e36665d5a86cf03afb97b936cf5ebdb35edd1bccd73a57cb1ce92be31940/oscodepoint-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "dd356b49e8b89658aaf94e9495be2bc3", "sha256": "fb7f6482960d46bbb37d93dee4d005e7e8674d4ec2e2d729e47a147ca45c9bef" }, "downloads": -1, "filename": "oscodepoint-0.2.tar.gz", "has_sig": false, "md5_digest": "dd356b49e8b89658aaf94e9495be2bc3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4339, "upload_time": "2012-02-07T18:10:07", "url": "https://files.pythonhosted.org/packages/5a/0e/11f1eb843b9b593dc04ac80e53ccb3485d13d4825481a048e12c90ac1475/oscodepoint-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "3812ad906ea5fddd9841c967c83b4782", "sha256": "dedc4ddcb5ad68b8b36ae1a3f7d6db716de48b13fe14c0e69b0a6b52cb431ad8" }, "downloads": -1, "filename": "oscodepoint-0.2.1.tar.gz", "has_sig": false, "md5_digest": "3812ad906ea5fddd9841c967c83b4782", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4346, "upload_time": "2014-03-27T16:33:10", "url": "https://files.pythonhosted.org/packages/80/1c/d0e4d79e86df66c289c64b4d6049a98c3c63882ad4bded73ab4da7274cec/oscodepoint-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3812ad906ea5fddd9841c967c83b4782", "sha256": "dedc4ddcb5ad68b8b36ae1a3f7d6db716de48b13fe14c0e69b0a6b52cb431ad8" }, "downloads": -1, "filename": "oscodepoint-0.2.1.tar.gz", "has_sig": false, "md5_digest": "3812ad906ea5fddd9841c967c83b4782", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4346, "upload_time": "2014-03-27T16:33:10", "url": "https://files.pythonhosted.org/packages/80/1c/d0e4d79e86df66c289c64b4d6049a98c3c63882ad4bded73ab4da7274cec/oscodepoint-0.2.1.tar.gz" } ] }