stdnum.ro.cf

CF (Cod de înregistrare în scopuri de TVA, Romanian VAT number).

The Romanian CF is used for VAT purposes and can be from 2 to 10 digits long.

>>> validate('RO 185 472 90')  # VAT CUI/CIF
'RO18547290'
>>> validate('185 472 90')  # non-VAT CUI/CIF
'18547290'
>>> validate('1630615123457')  # CNP
'1630615123457'
stdnum.ro.cf.compact(number)

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

stdnum.ro.cf.is_valid(number)

Check if the number is a valid VAT number.

stdnum.ro.cf.validate(number)

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