No project description provided
Project description
Nuts Finder 
You give it a point, it tells you all the EU NUTS regions.
Installation
pip install nuts-finder
Usage
from nuts_finder import NutsFinder
nf = NutsFinder() # <-- expect a little bit of loading time here whilst it downloads some shapefiles
nf.find(lat=53.406115, lon=-2.965604) # <-- a few seconds
>>> [{'CNTR_CODE': 'UK',
>>> 'FID': 'UK',
>>> 'LEVL_CODE': 0,
>>> 'NUTS_ID': 'UK',
>>> 'NUTS_NAME': 'UNITED KINGDOM'},
>>> {'CNTR_CODE': 'UK',
>>> 'FID': 'UKD',
>>> 'LEVL_CODE': 1,
>>> 'NUTS_ID': 'UKD',
>>> 'NUTS_NAME': 'NORTH WEST (ENGLAND)'},
>>> {'CNTR_CODE': 'UK',
>>> 'FID': 'UKD7',
>>> 'LEVL_CODE': 2,
>>> 'NUTS_ID': 'UKD7',
>>> 'NUTS_NAME': 'Merseyside'},
>>> {'CNTR_CODE': 'UK',
>>> 'FID': 'UKD72',
>>> 'LEVL_CODE': 3,
>>> 'NUTS_ID': 'UKD72',
>>> 'NUTS_NAME': 'Liverpool'}]
Advanced usage
The look-up is performed via point-in-polygon tests from the official repository of NUTS shapefiles. You can additionally specify the year (year) and scale (1:scale Million) of the downloaded shapefiles as follows:
nf = NutsFinder(year=2013, scale=60)
Note that the default year is the latest available, and the scale is the most granular available. At time of writing (late 2019), this was year=2016 and scale=1, respectively.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nuts_finder-0.1.2.tar.gz
(2.9 kB
view details)
File details
Details for the file nuts_finder-0.1.2.tar.gz.
File metadata
- Download URL: nuts_finder-0.1.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.19.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0876b1fa8d5f8efde83707c3902ecea2448aab7fa8c0bc4719e4b88b26031db
|
|
| MD5 |
68e76d985dbe18b59cd7fe6fea56cd52
|
|
| BLAKE2b-256 |
a633dcedf3171c57d269e008441e774413ccec7ebdcaa549f6c67cb975f25017
|