stdnum.us.ptin

PTIN (U.S. Preparer Tax Identification Number).

A Preparer Tax Identification Number (PTIN) is United States identification number for tax return preparers. It is an eight-digit number prefixed with a capital P.

>>> validate('P-00634642')
'P00634642'
>>> validate('P01594846')
'P01594846'
>>> validate('00634642')  # missing P
Traceback (most recent call last):
    ...
InvalidFormat: ...
stdnum.us.ptin.compact(number)

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

stdnum.us.ptin.is_valid(number)

Check if the number is a valid ATIN.

stdnum.us.ptin.validate(number)

Check if the number is a valid PTIN. This checks the length, groups and formatting if it is present.