# stdnum.ee.registrikood

Registrikood (Estonian organisation registration code).

All organisations are assigned a unique tax identification code from the commercial register, from the state register or from the non-profit associations and foundations register. The code consists of 8 digits.

Commercial company numbers start with a 1, schools and government numbers with a 7, non-profit organisations with an 8 and foundations with a 9. The number uses the same check digit algorithm as the Isikukood although that fact is undocumented.

More information:

- https://ariregister.rik.ee/

- https://mtr.mkm.ee/

    >>> validate('12345678')
    '12345678'
    >>> validate('12345679')
    Traceback (most recent call last):
        ...
    InvalidChecksum: ...
    >>> validate('32345674')
    Traceback (most recent call last):
        ...
    InvalidComponent: ...

stdnum.ee.registrikood.compact(number)

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

stdnum.ee.registrikood.is_valid(number)

  Check if the number provided is valid. This checks the length and check digit.

stdnum.ee.registrikood.validate(number)

  Check if the number provided is valid. This checks the length and check digit.