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 number to the standard presentation format.

stdnum.au.tfn.is_valid(number)

Check if the number is a valid TFN.

stdnum.au.tfn.validate(number)

Check if the number is a valid TFN. This checks the length, formatting and check digit.