stdnum.co.nit

NIT (Número De Identificación Tributaria, Colombian identity code).

This number, also referred to as RUT (Registro Unico Tributario) is a 10-digit code that includes a check digit.

>>> validate('213.123.432-1')
'2131234321'
>>> validate('2131234351')
'2131234351'
>>> validate('2131234350')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('213123435')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('213123435A')
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> format('2131234351')
'213.123.435-1'
Traceback (most recent call last):
    ...
InvalidFormat: ...
stdnum.co.nit.calc_check_digit(number)

Calculate the check digit. The number passed should not have the check digit included.

stdnum.co.nit.compact(number)

Convert the number to the minimal representation. This strips surrounding whitespace and separation dash.

stdnum.co.nit.format(number)

Reformat the passed number to the standard format.

stdnum.co.nit.is_valid(number)

Checks to see if the number provided is a valid number. This checks the length, formatting and check digit.

stdnum.co.nit.validate(number)

Checks to see if the number provided is a valid number. This checks the length, formatting and check digit.

Previous topic

stdnum.cn.ric

Next topic

stdnum.cy.vat