stdnum.me.iban

Montenegro IBAN (International Bank Account Number).

The IBAN is used to identify bank accounts across national borders. The Montenegro IBAN is built up of the IBAN prefix (ME) and check digits, followed by a 3 digit bank identifier, a 13 digit account number and 2 more check digits.

>>> validate('ME 2551 0000 0000 0623 4133')
'ME25510000000006234133'
>>> validate('ME52510000000006234132')  # incorrect national check digits
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('GR1601101050000010547023795')  # not a Montenegro IBAN
Traceback (most recent call last):
    ...
InvalidComponent: ...
stdnum.me.iban.compact(number: str) str

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

stdnum.me.iban.format(number: str, separator: str = ' ') str

Reformat the passed number to the space-separated format.

stdnum.me.iban.is_valid(number: str) bool

Check if the number provided is a valid Montenegro IBAN.

stdnum.me.iban.validate(number: str) str

Check if the number provided is a valid Montenegro IBAN.