stdnum.no.iban

Norwegian IBAN (International Bank Account Number).

The IBAN is used to identify bank accounts across national borders. The Norwegian IBAN is built up of the IBAN prefix (NO) and check digits, followed by the 11 digit Konto nr. (bank account number).

>>> validate('NO93 8601 1117 947')
'NO9386011117947'
>>> to_kontonr('NO93 8601 1117 947')
'86011117947'
>>> format('NO9386011117947')
'NO93 8601 1117 947'
>>> validate('GR1601101050000010547023795')  # different country
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> validate('NO92 8601 1117 947')  # invalid IBAN check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('NO23 8601 1117 946')  # invalid Konto nr. check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
stdnum.no.iban.compact(number)

Convert the iban number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.

stdnum.no.iban.format(number, separator=' ')

Reformat the passed number to the space-separated format.

stdnum.no.iban.to_kontonr(number)

Return the Norwegian bank account number part of the number.

stdnum.no.iban.validate(number)

Check if the number provided is a valid Norwegian IBAN.

stdnum.no.iban.is_valid(number)

Check if the number provided is a valid Norwegian IBAN.