Rodné číslo
Detect and validate Czech birth numbers with date parsing and MOD 11 checksum handling.
Purpose
Use the rodne_cislo detector for Czech birth numbers (rodné číslo).
This detector is designed for structured personal identifiers and has reported accuracy above 95%.
It validates the encoded date, handles both 9-digit and 10-digit variants, and exposes metadata that is useful for downstream policy decisions.
Detector Name
rodne_cisloSupported Formats
YYMMDD/XXXXYYMMDDXXXX- 9-digit pre-1954 form:
YYMMDD/XXXorYYMMDDXXX
FastPII strips / and spaces before validation.
For women, the encoded month typically uses +50.
Example: 53 means March for a female record.
Pre-1954 records use the 9-digit format and follow different year handling rules.
Validation Logic
The detector performs validation in this order:
- Remove
/and spaces. - Require 9 or 10 digits.
- Parse the embedded date.
- For 10-digit values, run the MOD 11 checksum check.
Date Rules
- 10-digit values use year mapping
00-53 -> 2000-2053,54-99 -> 1900-1999. - 9-digit values use year mapping
00-53 -> 1900-1953,54-99 -> 1800-1899. - The detector normalizes encoded month values before constructing a real date.
Checksum Algorithm
For 10-digit values:
- Take the first 9 digits.
- Compute
first_9_digits % 11. - If the remainder is
10, the expected checksum digit becomes0. - Otherwise, the expected checksum digit is the remainder.
- Compare that result with the last digit.
9-digit records do not use checksum validation in FastPII.
Python Examples
Validate a birth number
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["cz"])
result = guard.validate("8001011238", "rodne_cislo")
print(result.is_valid)
print(result.metadata)Detect in free text
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["cz"])
result = guard.detect("RČ: 800101/1238", detector_names=["rodne_cislo"])
for finding in result.findings:
print(finding.type, finding.value, finding.metadata)Expected Metadata
When validation or detection succeeds, this detector can return:
gender:maleorfemalebirth_date: normalized ISO date stringarticle_9:Truechecksum_valid: present for 10-digit values
Example Output
{
"gender": "male",
"birth_date": "1980-01-01",
"article_9": True,
"checksum_valid": True,
}Limitations
- 9-digit records validate by format and date only, not checksum.
- Metadata depends on successful date parsing.
- The detector is Czech-specific and should not be used for generic national ID formats.
- Birth numbers are highly sensitive personal data; FastPII marks them with
article_9 = True.
Notes
If you need a quick single-value check, this is the exact validation call verified in the codebase:
guard.validate("8001011238", "rodne_cislo")