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.

Metadata

Release files for ssb-nudb-use 2026.8.4

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

Source distribution (sdist)

Source distribution for ssb-nudb-use 2026.8.4
File Size Uploaded
ssb_nudb_use-2026.8.4.tar.gz 103.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ssb-nudb-use 2026.8.4
File Interpreter ABI Platform
ssb_nudb_use-2026.8.4-py3-none-any.whl Python 3 none any Details

Total release size: 252.1 kB

Release files / ssb_nudb_use-2026.8.4.tar.gz

Download URL ssb_nudb_use-2026.8.4.tar.gz
Size 103.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4184d5cd6727412a28273478ae8ee276914db1cb9489e8106dd64bdaf9db2779
BLAKE2b-256 checksum
How to use checksums
aa8bd3f0db00510d0d217289aee9fa7b7e9fbeaa97b5430d8fc33443f3f0bbe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

Release files / ssb_nudb_use-2026.8.4-py3-none-any.whl

Download URL ssb_nudb_use-2026.8.4-py3-none-any.whl
Size 148.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9bf6e71ee6c82db57d81f1e19f917f6cbe91a16ad361d6dce95d4dab40d8b4f
BLAKE2b-256 checksum
How to use checksums
48cb73d7b0a95452f1b76d20e06a874a12773c971f73a28f23f2ce9ccbc19255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.8.4 This release

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