Library South African ID number validation and easy data extraction.
Project description
za_identity_number
Library to validate/check and retrieve ID number info for South African IDs
Current version: 0.0.3
Poetry & pip compatibility
Python 3.5 or greater for f-strings
Installation:
pip:
pip install za-id-number
poetry:
poetry add za-id-number
ZA Id Numbers:
ZA id numbers are based on a luhn algorithm validation, with the last number validating that the entire number is correct.
ZA ID number is broken up into 2 digits birth year, 2 digits birth month, 2 digits birth date, 4 digits for gender, 1 digit for citizenship (za/other), 1 digit race (phased out after 1980) 1 digit for validation.
For more info: https://www.westerncape.gov.za/sites/www.westerncape.gov.za/files/sa-id-number-new.png
Easiest ZA ID validation is the length. The length must be exactly 13 integers.
Example:
from za_id_number.za_identity_number import SouthAfricanIdentityValidate
if __name__ == "__main__":
za_validation = SouthAfricanIdentityValidate("9202204720082")
valid = za_validation.validate()
za_identity = za_validation.identity()
print(f"Valid: {valid}, Identity: {za_identity}")
Methods:
SouthAfricanIdentityValidate("9202204720082").validate()
SouthAfricanIdentityValidate("9202204720082").identity()
SouthAfricanIdentityValidate("9202204720082").gender()
SouthAfricanIdentityValidate("9202204720082").citizen()
SouthAfricanIdentityValidate("9202204720082")identity_length()
SouthAfricanIdentityValidate("9202204720082").age()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file za-id-number-0.0.3.tar.gz
.
File metadata
- Download URL: za-id-number-0.0.3.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfda2c3b62b3eed8cba0d67a748b1115efb11d34c87aaa49f9e4608b2a8604ac |
|
MD5 | e2cac6ebf172993e121eb4153dfcd595 |
|
BLAKE2b-256 | 621064bebc69fe8e015988a61c7c68974236138708721235f33a24c27b5e8c1e |
File details
Details for the file za_id_number-0.0.3-py3.8.egg
.
File metadata
- Download URL: za_id_number-0.0.3-py3.8.egg
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0adf3e5754d715bf72e0e12a26bf279d6ab99e13a20903c9e0f6c936925470de |
|
MD5 | b4ff2110f6a266bd67da6b2819284c53 |
|
BLAKE2b-256 | 69ef2836c4ce74fd6f4fc644137f51c0663caab2102c6867173344deae5bc43b |
File details
Details for the file za_id_number-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: za_id_number-0.0.3-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 155b50367a28280473558d5211ebd1ba57a41537688933d27a8b451b92c34cbd |
|
MD5 | f6ad949d2c81e7d96d919a8099ac98c5 |
|
BLAKE2b-256 | dc2779624d2ed2a157639ff85a94c1a7a01af963a707e8d0e8faf549943b4d3f |