NIF (Numéro d’Immatriculation Fiscale, French tax identification number).

The NIF (Numéro d’Immatriculation Fiscale, Numéro d’Identité Fiscale or Numéro d’Identification Fiscale) also known as numéro fiscal de référence or SPI (Simplification des Procédures d’Identification) is a 13-digit number issued by the French tax authorities to people for tax reporting purposes.

More information:

>>> validate('0701987765432')
>>> validate('070198776543')
Traceback (most recent call last):
InvalidLength: ...
>>> format('0701987765432')
'07 01 987 765 432'

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 provided is a valid NIF.

Check if the number provided is a valid NIF.