Skip to main content

NUDB Use - is a usage-package for the Norwegian National Education Database cloud-data. Both for data-consumers and data-deliverers

Project description

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)

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)

Deriving variables not stored in data, is done by the derive module:

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

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.

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

ssb_nudb_use-2026.6.2.tar.gz (99.4 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.6.2-py3-none-any.whl (142.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ssb_nudb_use-2026.6.2.tar.gz
  • Upload date:
  • Size: 99.4 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.6.2.tar.gz
Algorithm Hash digest
SHA256 a6c94993d3946fe5b979ef663e7dfd759c77cecbd7deb0f2fcf99cf53e9c2fd4
MD5 77ccabfe9be8745df722f1d92cdfb7df
BLAKE2b-256 7e585715fd0027e5fd872f1ebdc93b1c419041e6a6c6d26b82527f5d9dd26883

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssb_nudb_use-2026.6.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.6.2-py3-none-any.whl.

File metadata

  • Download URL: ssb_nudb_use-2026.6.2-py3-none-any.whl
  • Upload date:
  • Size: 142.4 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.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74c774b1a44116e57bb71a3cd17dbc261809d6e400cf3b2242e3caf8cf79d3c5
MD5 74d0e0a42da497779002be5b1fe3cdfb
BLAKE2b-256 2147c0354f37d87eaa3bf93fc31b1b4b8e0fadcfb03bbfb5b5f99a61903addbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssb_nudb_use-2026.6.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.

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