Skip to main content

Lookup NUTS codes with country and ZIP code

Project description

nuts-lookup

Quick lookup of NUTS codes (NUTS-0, NUTS-1, NUTS-2, NUTS-3) by country (Alpha-2) and postal code using a compact in-memory SQLite database.

Installation

pip install nuts-lookup

Python API

from nuts_lookup import NutsLookup

lookup = NutsLookup()
print(lookup.get_nuts_code("DE", "10115"))    # Example: 'DE300' (NUTS-3)
print(lookup.get_nuts2_code("DE", "10115"))   # Example: 'DE30'  (NUTS-2)
print(lookup.get_nuts1_code("DE", "10115"))   # Example: 'DE3'   (NUTS-1)
print(lookup.get_nuts0_code("DE", "10115"))   # Example: 'DE'    (NUTS-0)

CLI

After installation, the nuts-lookup command is available:

nuts-lookup <COUNTRY_CODE> <POSTAL_CODE> [--level 0|1|2|3]
  • --level specifies the desired NUTS level (0, 1, 2, or 3). Default is 3 (NUTS-3).

Examples

nuts-lookup DE 10115           # Outputs NUTS-3 code (e.g. DE300)
nuts-lookup DE 10115 --level 2 # Outputs NUTS-2 code (e.g. DE30)
nuts-lookup DE 10115 --level 1 # Outputs NUTS-1 code (e.g. DE3)
nuts-lookup DE 10115 --level 0 # Outputs NUTS-0 code (e.g. DE)

License

MIT


Eurostat Copyright Notice

Please note that nuts-lookup is not developed, maintained, or affiliated with Eurostat. The following copyright notice from Eurostat regards their data, which underpins nuts-lookup:

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:

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").

The permission to use the data is granted on condition that:

  • the data will not be used for commercial purposes;
  • 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.

Copyright Notice

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, the 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:

  • EN: © EuroGeographics for the administrative boundaries
  • FR: © EuroGeographics pour les limites administratives
  • DE: © EuroGeographics bezüglich der Verwaltungsgrenzen

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.

If you intend to use the data commercially, please contact EuroGeographics for information regarding their licence agreements.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nuts_lookup-1.0.1.tar.gz (9.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nuts_lookup-1.0.1-py3-none-any.whl (10.0 MB view details)

Uploaded Python 3

File details

Details for the file nuts_lookup-1.0.1.tar.gz.

File metadata

  • Download URL: nuts_lookup-1.0.1.tar.gz
  • Upload date:
  • Size: 9.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for nuts_lookup-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a3a77e7c7815de5b517c701e6a93d5d25ee2fd0d6f1b745a4806e53df974957c
MD5 cc2849f568f9bc11f371de7de29f7d4e
BLAKE2b-256 bcdb357932c30248749076505d6e432f4d655cbe20d3acfa75b183075701c355

See more details on using hashes here.

File details

Details for the file nuts_lookup-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: nuts_lookup-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for nuts_lookup-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f933f3dd07bb7c7bf3194c2c86edaa2b077f626e7ac785939312a74151ffee5
MD5 8d43d9899db886881e73c808d1c67f66
BLAKE2b-256 f7e36f4f6b74394dd040c3eaf24fb267a2d89f7819381956dc4c6f23095f1820

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page