stdnum.iban

IBAN (International Bank Account Number).

The IBAN is used to identify bank accounts across national borders. The first two letters are a country code. The next two digits are check digits for the ISO 7064 Mod 97, 10 checksum. Each country uses it’s own format for the remainder of the number.

Some countries may also use checksum algorithms within their number but this is currently not checked by this number.

>>> validate('GR16 0110 1050 0000 1054 7023 795')
'GR1601101050000010547023795'
>>> validate('BE31435411161155')
'BE31435411161155'
>>> compact('GR16 0110 1050 0000 1054 7023 795')
'GR1601101050000010547023795'
>>> format('GR1601101050000010547023795')
'GR16 0110 1050 0000 1054 7023 795'
stdnum.iban.compact(number)

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

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

Reformat the passed number to the space-separated format.

stdnum.iban.is_valid(number)

Checks to see if the number provided is a valid IBAN.

stdnum.iban.validate(number)

Checks to see if the number provided is a valid IBAN.

Previous topic

stdnum.hu.anum

Next topic

stdnum.ie.pps