stdnum.me.pib

PIB (Poreski Identifikacioni Broj, Montenegro tax number).

This number consists of 8 digits.

More information:

>>> validate('02655284')
'02655284'
>>> validate('02655283')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('02655284')
'02655284'
stdnum.me.pib.calc_check_digit(number: str) str

Calculate the check digit for the number.

stdnum.me.pib.compact(number: str) str

Convert the number to the minimal representation.

This strips the number of any valid separators and removes surrounding whitespace.

stdnum.me.pib.format(number: str) str

Reformat the number to the standard presentation format.

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

Check if the number is a valid Montenegro PIB number.

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

Check if the number is a valid Montenegro PIB number.