stdnum.fr.nif

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')
'0701987765432'
>>> validate('070198776543')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format('0701987765432')
'07 01 987 765 432'
stdnum.fr.nif.compact(number)

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

stdnum.fr.nif.format(number)

Reformat the passed number to the standard format.

stdnum.fr.nif.is_valid(number)

Checks the length to see if the number provided is valid.

stdnum.fr.nif.validate(number)

Checks the length to see if the number provided is valid.