stdnum.ro.cui

CUI or CIF (Codul Unic de Înregistrare, Romanian company identifier).

The CUI (Codul Unic de Înregistrare) is assigned to companies that are required to register with the Romanian Trade Register. The CIF (Codul de identificare fiscală) is identical but assigned to entities that have no such requirement. The names seem to be used interchangeably and some sources suggest that CIF is the new name for CUI.

This number can change under some conditions. The number can be prefixed with RO to indicate that the entity has been registered for VAT.

More information:

>>> validate('185 472 90')
'18547290'
>>> validate('185 472 91')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('RO 185 472 90')  # the RO prefix is ignored
'18547290'
stdnum.ro.cui.calc_check_digit(number)

Calculate the check digit.

stdnum.ro.cui.compact(number)

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

stdnum.ro.cui.is_valid(number)

Check if the number is a valid CUI or CIF number.

stdnum.ro.cui.validate(number)

Check if the number is a valid CUI or CIF number. This checks the length, formatting and check digit.