stdnum.th.tin

TIN (Thailand Taxpayer Identification Number).

The Taxpayer Identification Number is used for tax purposes in the Thailand. This number consists of 13 digits which the last is a check digit.

Personal income taxpayers use Personal Identification Number (PIN) while companies use Memorandum of Association (MOA).

>>> validate('1-2345-45678-78-1')
'1234545678781'
>>> validate('0-99-4-000-61772-1')
'0994000617721'
>>> validate('1234545678789')
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> tin_type('1-2345-45678-78-1')
'pin'
>>> tin_type('0-99-4-000-61772-1')
'moa'
>>> format('3100600445635')
'3-1006-00445-63-5'
>>> format('0993000133978')
'0-99-3-000-13397-8'
stdnum.th.tin.compact(number)

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

stdnum.th.tin.format(number)

Reformat the number to the standard presentation format.

stdnum.th.tin.is_valid(number)

Check whether the number is valid.

stdnum.th.tin.tin_type(number)

Return a TIN type which this number is valid.

stdnum.th.tin.validate(number)

Check if the number is a valid TIN. This searches for the proper sub-type and validates using that.