Skip to main content

SSB-NUDB-USE

PyPI Status Python Version License

Documentation Tests Coverage Quality Gate Status

pre-commit Black Ruff Poetry

Description

NUDB is the National Education Database of Norway. It is operated by Statsitics Norway - section 360. This package is the main "usage-package" for those seeking to use NUDB-data, or deliver data to NUDB.

NUDBs data is kept as parquet files in GCP, and you will need seperate access to this data to utilize this package. Some features in this package might require access to other data, like BRREG (Brønnøysundregisteret), BOF (befolkningsregisteret), BOF (virksomhetsregisteret) etc.

Installation

You can install SSB Nudb Use via poetry from PyPI:

poetry add ssb-nudb-use

Dependencies

This package depends on the package "ssb-nudb-config", which contains metadata, but also points to content in other metadatasystems like Vardef, Klass and Datadoc.

Usage

Please see the Reference Guide for details.

Usage for extraction (data from NUDB)

NudbData()

The NudbData class allows easy access, filtering, and selection of data from NUDB. It automatically selects the latest version of the main datasets: AVSLUTTA, IGANG, and EKSAMEN, and also other virtual datasests like UTD_HOEYESTE.

from nudb_use import NudbData
df = (
  NudbData("igang") # get latest version of IGANG
  .select("snr", "nus2000", "utd_skoleaar_start") # SQL SELECT statement
  .where("utd_skoleaar_start = '2025'") # SQL WHERE statement
  .df() # Materialize view into a pandas DataFrame
)

derive

The derive module allows easy derivation of variables which aren't stored in the data. It automatically handles dependencies between derived variables (deriving variables in the correct order). To derive a variable my_variable you just do derive.<my_variable>(<my_data>). For example, to derive utd_skoleaar_slutt:

from nudb_use import derive
df = derive.utd_skoleaar_slutt(df)

Find the latest of each file shared.

from nudb_use import latest_shared_paths
latest_shared_paths()

Get the periods out of any paths following the SSB-naming standard.

from nudb_use import get_periods_from_path
get_periods_from_path(path)

Usage for delivery (data to NUDB)

We have renamed a lot of our variables transitioning from the old on-prem systems. If you are looking for the new or old names of variables, you can use the find_var or find_vars functions:

from nudb_use import find_vars
find_vars(["snr", "sosbak"])

Find the dtype and length (char-width) of strings using a dataeset name:

from nudb_use import look_up_dtype_length_for_dataset
print(look_up_dtype_length_for_dataset("igang_videregaaende"))

If you want to update the column names you have in a pandas dataframe, to the new column names - there's a function for that:

from nudb_use import update_colnames
df = update_colnames(df)

After renaming, you can get the pandas dtypes the columns should have with get_dtypes:

from nudb_use import get_dtypes
dtypes = get_dtypes(df)
df = df.astype(dtypes)

If you are delivering to NUDB, we want you to run our quality suite before sharing the data with us:

from nudb_use import run_quality_suite
run_quality_suite(df, "avslutta")

Data about your delivery, like "avslutta", should first have its data entered into, and released in the ssb-nudb-config package before available in this function. Contact the NUDB-team to define a new delivery.

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, SSB Nudb Use is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from Statistics Norway's SSB PyPI Template.

Download files

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

Source Distribution

ssb_nudb_use-2026.8.2.tar.gz (103.9 kB view details)

Uploaded Source

Built Distribution

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

ssb_nudb_use-2026.8.2-py3-none-any.whl (148.7 kB view details)

Uploaded Python 3

File details

Details for the file ssb_nudb_use-2026.8.2.tar.gz.

File metadata

  • Download URL: ssb_nudb_use-2026.8.2.tar.gz
  • Upload date:
  • Size: 103.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for ssb_nudb_use-2026.8.2.tar.gz
Algorithm Hash digest
SHA256 d87f98087ff9c13160a95ee298d45f0d9f414b3b32d1bfb4d3725cfa21d94650
MD5 f8b4e1a36208ba2fd42f27a2b7478a3e
BLAKE2b-256 43c7a260c1974d9b9d302a5f83b5f6f4ce7f8178d5b93deeeb21b458a41f7ffd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssb_nudb_use-2026.8.2.tar.gz:

Publisher: release.yml on statisticsnorway/ssb-nudb-use

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ssb_nudb_use-2026.8.2-py3-none-any.whl.

File metadata

  • Download URL: ssb_nudb_use-2026.8.2-py3-none-any.whl
  • Upload date:
  • Size: 148.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for ssb_nudb_use-2026.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 34811dc8503a570d568276fc1dfc77131fb617215852ae484de8f440a3007b00
MD5 e05e74c0de7e8f89c364369bd5c9cded
BLAKE2b-256 50f43057beb2859d1729c309c883f57fbf4cfd4d590b175cb85eb2e39be5cb37

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssb_nudb_use-2026.8.2-py3-none-any.whl:

Publisher: release.yml on statisticsnorway/ssb-nudb-use

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2026.8.2 This release

2 files

2026.8.1

2 files

2026.7.1

2 files

2026.6.12

2 files

2026.6.11

2 files

2026.6.10

2 files

2026.6.9

2 files

2026.6.8

2 files

2026.6.7

2 files

2026.6.6

2 files

2026.6.5

2 files

2026.6.4

2 files

2026.6.3

2 files

2026.6.2

2 files

2026.6.1

2 files

2026.5.11

2 files

2026.5.10

2 files

2026.5.9

2 files

2026.5.8

2 files

2026.5.7

2 files

2026.5.6

2 files

2026.5.5

2 files

2026.5.4

2 files

2026.5.3

2 files

2026.5.2

2 files

2026.5.1

2 files

2026.5.0

2 files

2026.4.7

2 files

2026.4.6

2 files

2026.4.5

2 files

2026.4.4

2 files

2026.4.3

2 files

2026.4.2

2 files

2026.4.1

2 files

2026.4.0

2 files

2026.3.8

2 files

2026.3.7

2 files

2026.3.6

2 files

2026.3.5

2 files

2026.3.4

2 files

2026.3.3

2 files

2026.3.2

2 files

2026.3.1

2 files

2026.3.0

2 files

2026.2.9

2 files

2026.2.8

2 files

2026.2.7

2 files

2026.2.5

2 files

2026.2.4

2 files

2026.2.3

2 files

2026.2.2

2 files

2026.2.1

2 files

2026.1.4

2 files

2026.1.3

2 files

2026.1.2

2 files

2026.1.1

2 files

2026.1.0

2 files

2025.12.6

2 files

2025.12.5

2 files

2025.12.4

2 files

2025.12.3

2 files

2025.12.2

2 files

2025.12.1

2 files

2025.12.0

2 files

2025.11.2

2 files

2025.11.1

2 files

2025.11.0

2 files

Supported by

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