stdnum.au.tfn

TFN (Australian Tax File Number).

The Tax File Number (TFN) is issued by the Australian Taxation Office (ATO) to taxpaying individuals and organisations. A business has both a TFN and an Australian Business Number (ABN).

The number consists of 8 (older numbers) or 9 digits and includes a check digit but otherwise without structure.

More information:

>>> validate('123 456 782')
'123456782'
>>> validate('999 999 999')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('123456782')
'123 456 782'
stdnum.au.tfn.checksum(number)

Calculate the checksum.

stdnum.au.tfn.compact(number)

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

stdnum.au.tfn.format(number)

Reformat the passed number to the standard format.

stdnum.au.tfn.is_valid(number)

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

stdnum.au.tfn.validate(number)

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