stdnum.fi.ytunnus¶
Y-tunnus (Finnish business identifier).
The number is an 8-digit code with a weighted checksum.
>>> validate('2077474-0')
'20774740'
>>> validate('2077474-1') # invalid check digit
Traceback (most recent call last):
...
InvalidChecksum: ...
>>> format('2077474-0')
'2077474-0'
-
stdnum.fi.ytunnus.compact(number)¶ Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
-
stdnum.fi.ytunnus.format(number)¶ Reformat the passed number to the standard format.
-
stdnum.fi.ytunnus.is_valid(number)¶ Checks to see if the number provided is a valid business identifier. This checks the length, formatting and check digit.
-
stdnum.fi.ytunnus.validate(number)¶ Checks to see if the number provided is a valid business identifier. This checks the length, formatting and check digit.