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: str) str ¶
Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
- stdnum.fi.ytunnus.format(number: str) str ¶
Reformat the number to the standard presentation format.
- stdnum.fi.ytunnus.is_valid(number: str) bool ¶
Check if the number is a valid business identifier.
- stdnum.fi.ytunnus.validate(number: str) str ¶
Check if the number is a valid business identifier. This checks the length, formatting and check digit.