# stdnum.fi.associationid

Finnish Association Identifier.

The number consists of 1 to 6 digits that are normally separated with a dot in groups of 0-3 and 0-3 numbers. E.g. 123.123, 12.123, 1.123, 123 or 1.

    >>> validate('123.123')
    '123123'
    >>> validate('1123')
    '1123'
    >>> validate('123123123')
    Traceback (most recent call last):
      ...
    InvalidLength: The number has an invalid length.
    >>> validate('12df')
    Traceback (most recent call last):
      ...
    InvalidFormat: The number has an invalid format.
    >>> format('123')
    '123'
    >>> format('1234')
    '1.234'

stdnum.fi.associationid.compact(number: str) → str

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

stdnum.fi.associationid.format(number: str) → str

  Reformat the number to the standard presentation format.

stdnum.fi.associationid.is_valid(number: str) → bool

  Check if the number is a valid association register number.

stdnum.fi.associationid.validate(number: str) → str

  Check if the number is a valid Finnish association register number. This checks the length and format.