stdnum.ua.rntrc

РНОКПП, RNTRC (Individual taxpayer registration number in Ukraine).

The РНОКПП (Реєстраційний номер облікової картки платника податків, registration number of the taxpayer’s registration card) is a unique identification number that is provided to individuals within Ukraine. The number consists of 10 digits, the last being a check digit.

More information:

>>> validate('1759013776')
'1759013776'
>>> validate('1759013770')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('12345')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format(' 25 30 41 40 71 ')
'2530414071'
stdnum.ua.rntrc.calc_check_digit(number)

Calculate the check digit for number.

stdnum.ua.rntrc.compact(number)

Convert the number to the minimal representation.

stdnum.ua.rntrc.format(number)

Reformat the number to the standard presentation format.

stdnum.ua.rntrc.is_valid(number)

Check if the number is a valid Ukraine RNTRC (РНОКПП) number.

stdnum.ua.rntrc.validate(number)

Check if the number is a valid Ukraine RNTRC (РНОКПП) number.

This checks the length, formatting and check digit.