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: ...
Traceback (most recent call last):
...
InvalidFormat: ...
Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
Checks to see if the number provided is a valid ATIN. This checks the length, groups and formatting if it is present.
Checks to see if the number provided is a valid PTIN. This checks the length, groups and formatting if it is present.