# stdnum.fr.siren

SIREN (a French company identification number).

The SIREN (Système d’Identification du Répertoire des Entreprises) is a 9 digit number used to identify French companies. The Luhn checksum is used to validate the numbers.

    >>> compact('552 008 443')
    '552008443'
    >>> validate('404833048')
    '404833048'
    >>> validate('404833047')
    Traceback (most recent call last):
        ...
    InvalidChecksum: ...
    >>> to_tva('443 121 975')
    '46 443 121 975'

stdnum.fr.siren.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.siren.is_valid(number: str) → bool

  Check if the number provided is a valid SIREN.

stdnum.fr.siren.to_tva(number: str) → str

  Return a TVA that prepends the two extra check digits to the SIREN.

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

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