{ "info": { "author": "Nesta", "author_email": "software_development@nesta.org.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.7" ], "description": "# Nuts Finder [![Build Status](https://travis-ci.com/nestauk/nuts_finder.svg?branch=master)](https://travis-ci.com/nestauk/nuts_finder)\n\nYou give it a point, it tells you all the EU NUTS regions.\n\n## Installation\n\n```bash\n\npip install nuts-finder\n```\n\n## Usage\n\n```python\n\nfrom nuts_finder import NutsFinder\n\nnf = NutsFinder() # <-- expect a little bit of loading time here whilst it downloads some shapefiles\nnf.find(lat=53.406115, lon=-2.965604) # <-- pretty quick\n\n>>> [{'CNTR_CODE': 'UK',\n>>> 'FID': 'UK',\n>>> 'LEVL_CODE': 0,\n>>> 'NUTS_ID': 'UK',\n>>> 'NUTS_NAME': 'UNITED KINGDOM'},\n>>> {'CNTR_CODE': 'UK',\n>>> 'FID': 'UKD',\n>>> 'LEVL_CODE': 1,\n>>> 'NUTS_ID': 'UKD',\n>>> 'NUTS_NAME': 'NORTH WEST (ENGLAND)'},\n>>> {'CNTR_CODE': 'UK',\n>>> 'FID': 'UKD7',\n>>> 'LEVL_CODE': 2,\n>>> 'NUTS_ID': 'UKD7',\n>>> 'NUTS_NAME': 'Merseyside'},\n>>> {'CNTR_CODE': 'UK',\n>>> 'FID': 'UKD72',\n>>> 'LEVL_CODE': 3,\n>>> 'NUTS_ID': 'UKD72',\n>>> 'NUTS_NAME': 'Liverpool'}]\n```\n\n## Give me the shapes\n\nYou can access all of the NUTS boundaries via:\n\n```python\n\nnf = NutsFinder()\nnf.shapes\n\n>>> {\"crs\": {\"properties\": {\"name\": \"urn:ogc:def:crs:EPSG::4326\"}, \"type\": \"name\"}, \"features\": [{\"geometry\": {\"coordinates\": [[[16.107, 50.662], [16.333, 50.592], [16.58, 50.143], [15.438, 50.11], [15.147, 50.523], [15.42, 50.5], [15.584, 50.627], [15.535, 50.779], [16.107, 50.662]]], \"type\": \"Polygon\"}, \"id\": \"CZ052\", \"properties\": {\"CNTR_CODE\": \"CZ\", \"FID\": \"CZ052\", \"LEVL_CODE\": 3, \"NUTS_ID\": \"CZ052\", \"NUTS_NAME\": \"Kr\\\\u00e1lov\\\\u00e9hradeck\\\\u00fd kraj\"}, \"type\": \"Feature\"}, ...}\n```\n\n## Advanced usage\n\nThe look-up is performed via point-in-polygon tests from the [official repository of NUTS shapefiles](https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/nuts). You can additionally specify the year (`year`) and scale (1:`scale` Million) of the downloaded shapefiles as follows:\n\n```python\nnf = NutsFinder(year=2013, scale=60)\n```\n\nNote that the default year is the latest available, and the scale is the median available. At time of writing the available years were `{2003, 2006, 2010, 2013, 2016}` and available scales were `{1, 3, 10, 20, 60}`.\n\n## Points near rivers and coastlines\n\nUnless you use `scale=1`, expect to lose some coverage of points very near to water features (coastal and river regions). If you would like to optimise for speed, you might consider a recursive strategy of using a coarser `NutsFinder` followed by a more granular one to pick up missed points.\n\n## Speed-ups\n\nThe `find(...)` method is significantly faster for coarser geographical scales. For most purposes, a scale of around 10 should be sufficient. See below for a benchmark on my laptop (macOS, 2.3 GHz, 16GB) against the scales available at the time of writing:\n\n| `scale` | time |\n| ---------|:-------------------------:|\n| 1 | 2.66 s \u00b1 191 ms per loop |\n| 3 | 608 ms \u00b1 15 ms per loop |\n| 10 | 215 ms \u00b1 1.85 ms per loop |\n| 20 | 145 ms \u00b1 11.6 ms per loop |\n| 60 | 105 ms \u00b1 14 ms per loop |\n\n\n# Eurostat copyright notice\n\nPlease note that `nuts-finder` is not developed, maintained or affiliated with Eurostat. The following [copyright notice from Eurostat](https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units) regards their data, which underpins `nuts-finder`:\n\n> In addition to the general copyright and licence policy applicable to the whole Eurostat website, the following specific provisions apply to the datasets you are downloading. The download and usage of these data is subject to the acceptance of the following clauses:\n>\n> 1. The Commission agrees to grant the non-exclusive and not transferable right to use and process the Eurostat/GISCO geographical data downloaded from this page (the \"data\").\n> \n> 2. The permission to use the data is granted on condition that:\n> \n> * the data will not be used for commercial purposes;\n> * the source will be acknowledged. A copyright notice, as specified below, will have to be visible on any printed or electronic publication using the data downloaded from this page.\n>\n> Copyright notice\n> ----------------\n> \n> When data downloaded from this page is used in any printed or electronic publication, in addition to any other provisions applicable to the whole Eurostat website, data source will have to be acknowledged in the legend of the map and in the introductory page of the publication with the following copyright notice:\n>\n> * EN: \u00a9 EuroGeographics for the administrative boundaries\n> * FR: \u00a9 EuroGeographics pour les limites administratives\n> * DE: \u00a9 EuroGeographics bez\u00fcglich der Verwaltungsgrenzen\n>\n> For publications in languages other than English, French or German, the translation of the copyright notice in the language of the publication shall be used.\n>\n> If you intend to use the data commercially, please contact EuroGeographics for information regarding their licence agreements.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nestauk/nuts_finder", "keywords": "", "license": "MIT", "maintainer": "Nesta", "maintainer_email": "software_development@nesta.org.uk", "name": "nuts-finder", "package_url": "https://pypi.org/project/nuts-finder/", "platform": "", "project_url": "https://pypi.org/project/nuts-finder/", "project_urls": { "Homepage": "https://github.com/nestauk/nuts_finder" }, "release_url": "https://pypi.org/project/nuts-finder/21.5.5.14/", "requires_dist": [ "geojson (==2.5.0)", "requests (==2.22.0)", "Shapely (==1.6.2.post1)" ], "requires_python": ">3.6", "summary": "", "version": "21.5.5.14", "yanked": false, "yanked_reason": null }, "last_serial": 10273727, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "68e76d985dbe18b59cd7fe6fea56cd52", "sha256": "a0876b1fa8d5f8efde83707c3902ecea2448aab7fa8c0bc4719e4b88b26031db" }, "downloads": -1, "filename": "nuts_finder-0.1.2.tar.gz", "has_sig": false, "md5_digest": "68e76d985dbe18b59cd7fe6fea56cd52", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 2918, "upload_time": "2019-10-23T15:24:10", "upload_time_iso_8601": "2019-10-23T15:24:10.942798Z", "url": "https://files.pythonhosted.org/packages/a6/33/dcedf3171c57d269e008441e774413ccec7ebdcaa549f6c67cb975f25017/nuts_finder-0.1.2.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "a17e7558fe362c53147b2802cd3fb0ef", "sha256": "85bd33e8b762e52159b646cebe6a1717e85f9bbe8cd4790ba923c2b764e605bc" }, "downloads": -1, "filename": "nuts_finder-0.1.3.tar.gz", "has_sig": false, "md5_digest": "a17e7558fe362c53147b2802cd3fb0ef", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 3624, "upload_time": "2019-10-24T10:45:37", "upload_time_iso_8601": "2019-10-24T10:45:37.707072Z", "url": "https://files.pythonhosted.org/packages/78/a2/6ab7a3197cde6da9f06f74eda4401c771d4a69d5efa4e710555cfd62fe7f/nuts_finder-0.1.3.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "21477d0eebfb82ef29c8b3488f47a124", "sha256": "b578520c8dbc1ba49b12cd0bac55d62d5d7a6e5c059a7487ccaafd5f7a675c8e" }, "downloads": -1, "filename": "nuts_finder-0.1.4.tar.gz", "has_sig": false, "md5_digest": "21477d0eebfb82ef29c8b3488f47a124", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 3609, "upload_time": "2019-11-07T11:18:27", "upload_time_iso_8601": "2019-11-07T11:18:27.101526Z", "url": "https://files.pythonhosted.org/packages/b7/dd/0311ceba1146a926573cb0dcccda3e0dce93df56abc755836e82fb08d7b9/nuts_finder-0.1.4.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "5493e6699542adc05b4e501b735293e6", "sha256": "714d4c9810f90e6da55f1387b971b04b7e04453150f69d1b9a21e03e5e0767f0" }, "downloads": -1, "filename": "nuts_finder-0.1.5.tar.gz", "has_sig": false, "md5_digest": "5493e6699542adc05b4e501b735293e6", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 3810, "upload_time": "2019-11-07T13:55:59", "upload_time_iso_8601": "2019-11-07T13:55:59.456295Z", "url": "https://files.pythonhosted.org/packages/ce/e1/40d5701e0a8b2b485c7d311d79f617470a74d9980d1040e7b0355ae9ea2d/nuts_finder-0.1.5.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "b0a113d392062374cc385433f8419fd7", "sha256": "1c7b6c8331edf1dc87669e3d6dbb730385eda7902687f92e9456b58ac99fb952" }, "downloads": -1, "filename": "nuts_finder-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "b0a113d392062374cc385433f8419fd7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 4020, "upload_time": "2020-11-05T15:41:03", "upload_time_iso_8601": "2020-11-05T15:41:03.189070Z", "url": "https://files.pythonhosted.org/packages/a3/eb/705eea8d48ab3c80002617b48577e69c85a8eb946d4710e1defa28563f64/nuts_finder-0.1.6-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "b2f3224705b54087bdf5eb6d3dc385c7", "sha256": "b17626af7e789649cd3b2a188c9feb1f278d0ad3af61689f04f74a72eae63b71" }, "downloads": -1, "filename": "nuts_finder-0.1.6.tar.gz", "has_sig": false, "md5_digest": "b2f3224705b54087bdf5eb6d3dc385c7", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 3823, "upload_time": "2020-11-05T15:41:04", "upload_time_iso_8601": "2020-11-05T15:41:04.622777Z", "url": "https://files.pythonhosted.org/packages/72/77/0a76ae5253cd458db41e81d8d72fdb870585632eb8d35fae64fd5fb3eb20/nuts_finder-0.1.6.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "f49d27654b12ed69db128bce855a3522", "sha256": "1b5bcd41cf49c58720ee38b84032a3b2a8668caa84d15333197277b407aec873" }, "downloads": -1, "filename": "nuts_finder-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "f49d27654b12ed69db128bce855a3522", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 4032, "upload_time": "2020-11-06T10:47:19", "upload_time_iso_8601": "2020-11-06T10:47:19.051162Z", "url": "https://files.pythonhosted.org/packages/51/cd/aad6201956a03e5f082f4ceb2625e620687f6296a22cbc6214697f00a0a2/nuts_finder-0.1.7-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "c538164f5dae6e4c5b6e1867a2facce0", "sha256": "6cbbe37fd783c71a13b987f0049f9fbfbac54e1cbdbac0c10a29e524ad4b871b" }, "downloads": -1, "filename": "nuts_finder-0.1.7.tar.gz", "has_sig": false, "md5_digest": "c538164f5dae6e4c5b6e1867a2facce0", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 3838, "upload_time": "2020-11-06T10:47:21", "upload_time_iso_8601": "2020-11-06T10:47:21.466780Z", "url": "https://files.pythonhosted.org/packages/d2/be/263791d3948ee6ca4dca5fed9476c0a6a61ce5ca56353c784dfc979d7f93/nuts_finder-0.1.7.tar.gz", "yanked": false, "yanked_reason": null } ], "21.5.5.10": [ { "comment_text": "", "digests": { "md5": "4884d2f8d627a854c6e7085f1d553bd9", "sha256": "4ab17ce9fc1e6e8fc4e201f4f0fbb7b39d0678c5fbcfbbd1f28f7df29fbae1d7" }, "downloads": -1, "filename": "nuts_finder-21.5.5.10-py3-none-any.whl", "has_sig": false, "md5_digest": "4884d2f8d627a854c6e7085f1d553bd9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 6580, "upload_time": "2021-05-05T16:17:59", "upload_time_iso_8601": "2021-05-05T16:17:59.858119Z", "url": "https://files.pythonhosted.org/packages/c7/81/487978d6a17b123113a575ede3399478b678aa0f18f3a226a6089cba4e26/nuts_finder-21.5.5.10-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "70cf47cab6ad81680a3d359909d28de2", "sha256": "d42be81df93f8714d7f340f3fe372087c121e843f2246e04782de6a644817a24" }, "downloads": -1, "filename": "nuts_finder-21.5.5.10.tar.gz", "has_sig": false, "md5_digest": "70cf47cab6ad81680a3d359909d28de2", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 6298, "upload_time": "2021-05-05T16:18:00", "upload_time_iso_8601": "2021-05-05T16:18:00.873114Z", "url": "https://files.pythonhosted.org/packages/81/39/13e9eea583bda1041cb48f0d9ce8f2acca7bf0239d86f56cb77016ec66e9/nuts_finder-21.5.5.10.tar.gz", "yanked": false, "yanked_reason": null } ], "21.5.5.14": [ { "comment_text": "", "digests": { "md5": "ea658a99bcaea3996429b65195eb3069", "sha256": "38f39c896cc729b38fbd5daa656b09dbef65eb1f269fcf549fcb2993ab5b2bc7" }, "downloads": -1, "filename": "nuts_finder-21.5.5.14-py3-none-any.whl", "has_sig": false, "md5_digest": "ea658a99bcaea3996429b65195eb3069", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 6623, "upload_time": "2021-05-06T08:43:11", "upload_time_iso_8601": "2021-05-06T08:43:11.692062Z", "url": "https://files.pythonhosted.org/packages/5d/32/71708614740d668f8fd9e6ac4178f72d3de3ab7cefe6f62a9d9ce0162048/nuts_finder-21.5.5.14-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "577ee3d5022601027d3ac1035846caee", "sha256": "ab57ea0c2064c587ae22da60803a1627bd7df814ad332d37aba9cee4ca87483b" }, "downloads": -1, "filename": "nuts_finder-21.5.5.14.tar.gz", "has_sig": false, "md5_digest": "577ee3d5022601027d3ac1035846caee", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 6334, "upload_time": "2021-05-06T08:43:12", "upload_time_iso_8601": "2021-05-06T08:43:12.768756Z", "url": "https://files.pythonhosted.org/packages/0e/9c/59f6e569ef6f3c2214bb2982327e323de27830d89785c1860bfdf06eb186/nuts_finder-21.5.5.14.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ea658a99bcaea3996429b65195eb3069", "sha256": "38f39c896cc729b38fbd5daa656b09dbef65eb1f269fcf549fcb2993ab5b2bc7" }, "downloads": -1, "filename": "nuts_finder-21.5.5.14-py3-none-any.whl", "has_sig": false, "md5_digest": "ea658a99bcaea3996429b65195eb3069", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 6623, "upload_time": "2021-05-06T08:43:11", "upload_time_iso_8601": "2021-05-06T08:43:11.692062Z", "url": "https://files.pythonhosted.org/packages/5d/32/71708614740d668f8fd9e6ac4178f72d3de3ab7cefe6f62a9d9ce0162048/nuts_finder-21.5.5.14-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "577ee3d5022601027d3ac1035846caee", "sha256": "ab57ea0c2064c587ae22da60803a1627bd7df814ad332d37aba9cee4ca87483b" }, "downloads": -1, "filename": "nuts_finder-21.5.5.14.tar.gz", "has_sig": false, "md5_digest": "577ee3d5022601027d3ac1035846caee", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 6334, "upload_time": "2021-05-06T08:43:12", "upload_time_iso_8601": "2021-05-06T08:43:12.768756Z", "url": "https://files.pythonhosted.org/packages/0e/9c/59f6e569ef6f3c2214bb2982327e323de27830d89785c1860bfdf06eb186/nuts_finder-21.5.5.14.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }