SIN (Canadian Social Insurance Number).

The Social Insurance Number (SIN) is a 9-digit identifier issued to individuals for various government programs. SINs that begin with a 9 are issued to temporary workers who are neither Canadian citizens nor permanent residents.

More information:

>>> validate('123-456-782')
>>> validate('999-999-999')
Traceback (most recent call last):
InvalidChecksum: ...
>>> validate('12345678Z')
Traceback (most recent call last):
InvalidFormat: ...
>>> format('123456782')

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

Reformat the number to the standard presentation format.

Check if the number is a valid SIN.

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