# 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://ec.europa.eu/taxation_customs/tin/tinByCountry.html

- https://fr.wikipedia.org/wiki/Numéro_d%27Immatriculation_Fiscale#France

    >>> validate('3023217600053')
    '3023217600053'
    >>> validate('3023217600054')
    Traceback (most recent call last):
        ...
    InvalidChecksum: ...
    >>> validate('070198776543')
    Traceback (most recent call last):
        ...
    InvalidLength: ...
    >>> validate('9701987765432')
    Traceback (most recent call last):
        ...
    InvalidComponent: ...
    >>> format('3023217600053')
    '30 23 217 600 053'

stdnum.fr.nif.calc_check_digits(number: str) → str

  Calculate the check digits for the number.

stdnum.fr.nif.compact(number: str) → str

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

stdnum.fr.nif.format(number: str) → str

  Reformat the number to the standard presentation format.

stdnum.fr.nif.is_valid(number: str) → bool

  Check if the number provided is a valid NIF.

stdnum.fr.nif.validate(number: str) → str

  Check if the number provided is a valid NIF.