Skip to main content

Make and verify official Norwegian numbers like: KID-nummer, organisasjonsnummer, fødselsnummer, kontonummer

Project description

Norwegian numbers

PyPI Build Status Coverage Status License

Make and verify official Norwegian numbers:

  • KID-nummer: make_kid_number and verify_kid_number
  • Organisasjonsnummer: make_organisation_number and verify_organisation_number
  • Fødselsnummer: make_birth_number and verify_birth_number
  • Kontonummer: make_account_number and verify_account_number

This currently only concerns itself with the control digits.


To install from PyPi as a module in your environment:

pip install norwegian-numbers

To install from source as a module in your environment:

python install

Code usage from installation

Example code usages after installation:

>>> import norwegian_numbers as nn
>>> nn.make_kid_number('1234', 'mod10')
>>> nn.verify_kid_number('12344', 'mod10')
>>> nn.make_account_number('1234567890')
>>> nn.make_organisation_number('12345678')
>>> nn.make_birth_number('311299567')

Running from command line

Usage from command line:

$ python -m norwegian_numbers --help
usage: [-h]
                (-m {kid10,kid11,organisation,birth,account} | -v {kid10,kid11,organisation,birth,account})

Generate or verify KID-nummer, organisasjonsnummer, fødselsnummer, kontonummer

positional arguments:
value                 The value to make or verify based on

optional arguments:
-h, --help            show this help message and exit
-m {kid10,kid11,organisation,birth,account}, --make {kid10,kid11,organisation,birth,account}
                        Choose what to make
-v {kid10,kid11,organisation,birth,account}, --verify {kid10,kid11,organisation,birth,account}
                        Choose what to verify

Example usage:

$ python -m norwegian_numbers -m kid10 1234
$ python -m norwegian_numbers -v kid10 12344
$ python -m norwegian_numbers -m account 1234567890
$ python -m norwegian_numbers -m organisation 12345678
$ python -m norwegian_numbers -m birth 311299567

Testing from source

To run the tests:

python -m unittest discover

Or if you have tox:


Or for coverage (with html report):

coverage run -m unittest discover
coverage html


Some sources on the background material:


The distribution was created by the following commands:

python sdist bdist_wheel
python -m twine upload dist/*

Project details

Download files

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

Files for norwegian-numbers, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size norwegian_numbers-1.0.2-py3-none-any.whl (5.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size norwegian-numbers-1.0.2.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page