Skip to main content

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.

Release files for nuts-lookup 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nuts-lookup 1.0.1
File Size Uploaded
nuts_lookup-1.0.1.tar.gz 9.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for nuts-lookup 1.0.1
File Interpreter ABI Platform
nuts_lookup-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 MB

Release files / nuts_lookup-1.0.1.tar.gz

Download URL nuts_lookup-1.0.1.tar.gz
Size 9.2 MB
Tags Source
SHA-256 checksum
How to use checksums
a3a77e7c7815de5b517c701e6a93d5d25ee2fd0d6f1b745a4806e53df974957c
BLAKE2b-256 checksum
How to use checksums
bcdb357932c30248749076505d6e432f4d655cbe20d3acfa75b183075701c355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.1

Release files / nuts_lookup-1.0.1-py3-none-any.whl

Download URL nuts_lookup-1.0.1-py3-none-any.whl
Size 10.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2f933f3dd07bb7c7bf3194c2c86edaa2b077f626e7ac785939312a74151ffee5
BLAKE2b-256 checksum
How to use checksums
f7e36f4f6b74394dd040c3eaf24fb267a2d89f7819381956dc4c6f23095f1820
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page