stdnum.fr.nif¶
NIF (Numéro d’Immatriculation Fiscale, French tax identification number).
The NIF (Numéro d’Immatriculation 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:
https://fr.wikipedia.org/wiki/Numéro_d%27Immatriculation_Fiscale#France
>>> validate('0701987765432')
'0701987765432'
>>> validate('070198776543')
Traceback (most recent call last):
...
InvalidLength: ...
>>> validate('9701987765432')
Traceback (most recent call last):
...
InvalidComponent: ...
>>> 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 number to the standard presentation format.
- stdnum.fr.nif.is_valid(number)¶
Check if the number provided is a valid NIF.
- stdnum.fr.nif.validate(number)¶
Check if the number provided is a valid NIF.