stdnum.sk.rc

RČ (Rodné číslo, the Slovak birth number).

The birth number (RČ, Rodné číslo) is the Slovak national identifier. The number can be 9 or 10 digits long. Numbers given out after January 1st 1954 should have 10 digits. The number includes the birth date of the person and their gender.

This number is identical to the Czech counterpart.

>>> validate('710319/2745')
'7103192745'
>>> validate('991231123')
'991231123'
>>> validate('7103192746')  # invalid check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('1103492745')  # invalid date
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> validate('590312/123')  # 9 digit number in 1959
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format('7103192745')
'710319/2745'
stdnum.sk.rc.compact(number)

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

stdnum.sk.rc.format(number)

Reformat the number to the standard presentation format.

stdnum.sk.rc.is_valid(number)

Check if the number is a valid birth number.

stdnum.sk.rc.validate(number)

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