stdnum.nz.ird

IRD number (New Zealand Inland Revenue Department (Te Tari Tāke) number).

The IRD number is used by the New Zealand Inland Revenue Department (Te Tari Tāke in Māori) to identify businesses and individuals for tax purposes. The number consists of 8 or 9 digits where the last digit is a check digit.

More information:

>>> validate('4909185-0')
'49091850'
>>> validate('NZ 49-098-576')
'49098576'
>>> validate('136410133')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('9125568')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format('49098576')
'49-098-576'
stdnum.nz.ird.calc_check_digit(number)

Calculate the check digit.

The number passed should not have the check digit included.

stdnum.nz.ird.compact(number)

Convert the number to the minimal representation.

stdnum.nz.ird.format(number)

Reformat the number to the standard presentation format.

stdnum.nz.ird.is_valid(number)

Check if the number is a valid IRD number.

stdnum.nz.ird.validate(number)

Check if the number is a valid IRD number.