# stdnum.fr.rcs

RCS (French trade registration number for commercial companies).

The RCS number (Registre du commerce et des sociétés) is given by INSEE to a company with commercial activity when created. It is required for most of administrative procedures.

The number consists of “RCS” letters followed by name of the city where the company was registered followed by letter A for a retailer or B for society followed by the SIREN number

More information:

- https://entreprendre.service-public.fr/vosdroits/F31190

- https://fr.wikipedia.org/wiki/Registre_du_commerce_et_des_sociétés_(France)

    >>> validate('RCS Nancy B 323 159 715')
    'RCS Nancy B 323159715'
    >>> validate('RCS Nancy B 323 159 716')
    Traceback (most recent call last):
        ...
    InvalidChecksum: ...
    >>> validate('RCSNancy B 323 159 716')
    Traceback (most recent call last):
        ...
    InvalidFormat: ...
    >>> format('RCS Nancy B323159715')
    'RCS Nancy B 323 159 715'
    >>> to_siren('RCS Nancy B 323159 715')
    '323159715'

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

  Convert the number to the minimal representation.

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

  Reformat the number to the standard presentation format.

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

  Check if the number provided is valid.

stdnum.fr.rcs.to_siren(number: str) → str

  Extract SIREN number from the RCS number.

  The SIREN number is the 9 last digits of the RCS number.

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

  Validate number is a valid French RCS number.