stdnum.us.atin

ATIN (U.S. Adoption Taxpayer Identification Number).

An Adoption Taxpayer Identification Number (ATIN) is a temporary nine-digit number issued by the United States IRS for a child for whom the adopting parents cannot obtain a Social Security Number.

>>> validate('123-45-6789')
'123456789'
>>> validate('1234-56789')  # dash in the wrong place
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> format('123456789')
'123-45-6789'
>>> format('123')  # unknown formatting is left alone
'123'
stdnum.us.atin.compact(number)

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

stdnum.us.atin.format(number)

Reformat the number to the standard presentation format.

stdnum.us.atin.is_valid(number)

Check if the number is a valid ATIN.

stdnum.us.atin.validate(number)

Check if the number is a valid ATIN. This checks the length and formatting if it is present.