ctnx.validation module¶
- class ctnx.validation.CccdResult(id: str, is_male: bool, birth_year: int, birth_country: str, birth_province: str = '')[source]¶
Bases:
tupleContain 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]¶
Check whether a Vietnamese Citizen Identity Card (Căn cước công dân) number is vaild or not.
- ctnx.validation.parse_cccd(raw: int | str) CccdResult[source]¶
Extract information from a Vietnamese Citizen Identity Card (Căn cước công dân) number.
- Parameters:
- Returns:
A named tuple contains the extracted information, consist of gender, date of birth, register place and the incremental ID
- Return type:
- Raises:
ParseError – If the ID is invalid