ctnx.validation module¶
- class ctnx.validation.CccdResult(id: str, is_male: bool, birth_year: int, birth_country: str, birth_province: str = '')[source]¶
Bases:
tupleContains information of a parsed Vietnamese Citizen Identity Card (Căn cước công dân) number.
- exception ctnx.validation.ParseError(message, pos: int, *args)[source]¶
Bases:
ValueError
- ctnx.validation.is_valid_cccd(raw: int | str) bool[source]¶
Checks whether a Vietnamese Citizen Identity Card (Căn cước công dân) number is valid or not.
- ctnx.validation.parse_cccd(raw: int | str) CccdResult[source]¶
Extracts information from a Vietnamese Citizen Identity Card (Căn cước công dân) number.
- Parameters:
- Returns:
A named tuple containing the extracted information, consisting of gender, date of birth, registration place, and the unique sequential ID
- Return type:
- Raises:
ParseError – If the ID is invalid