stdnum.cz.rc

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

The birth number (RČ, Rodné číslo) is the Czech 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 Slovak 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.cz.rc.compact(number)

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

stdnum.cz.rc.format(number)

Reformat the number to the standard presentation format.

stdnum.cz.rc.get_birth_date(number)

Split the date parts from the number and return the birth date.

stdnum.cz.rc.is_valid(number)

Check if the number is a valid birth number.

stdnum.cz.rc.validate(number)

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