A Python package to validate MyKad numbers
Project description
MyKad
A Python package to check if a MyKad number is valid and gets information such as the birthdate, state of birth, etc.
Warning: This is still in pre-release so expect API breakages between versions.
The MyKad
class
from mykad.mykad import MyKad
mykad = MyKad(MYKAD_NUMBER)
The following methods are included in the MyKad
class:
Method | Comment | Example return value |
---|---|---|
get_unformatted() |
Gets the unformatted MyKad string. | '990111431234' |
get_formatted() |
Gets the formatted MyKad string. | '990111-43-1234' |
get_birth_year() |
Gets the birthyear of the MyKad holder in YY format. | '99' |
get_pretty_birth_year() |
Gets the birthyear of the MyKad holder in YYYY format. | '1998' |
get_birth_month() |
Gets the birth month of the MyKad holder in MM format. | '01' |
get_pretty_birth_month() |
Gets the birth month of the MyKad holder in English. | 'January' |
get_birth_day() |
Gets the day of birth of the MyKad holder in DD format. | '11' |
get_pretty_birth_day() |
Gets the day of birth of the MyKad holder in English. | 'Monday' |
get_birthplace_code() |
Gets the birthplace code of the MyKad holder. | '43' |
get_birthplace() |
Gets the birthplace of the MyKad holder. | 'Selangor' |
is_male() |
Checks if the MyKad holder is a male. | False |
is_female() |
Checks if the MyKad holder is a female. | True |
get_gender() |
Gets the gender of the MyKad holder. | 'Female' |
Included utility functions
The following utility functions are included under mykad.utils
:
Method | Comment | Example return value |
---|---|---|
is_mykad_valid |
Checks if a MyKad is valid. | False |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mykad-0.1.0.tar.gz
(4.4 kB
view details)
Built Distribution
mykad-0.1.0-py3-none-any.whl
(5.0 kB
view details)
File details
Details for the file mykad-0.1.0.tar.gz
.
File metadata
- Download URL: mykad-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50d8ef5a4db14bdc2d6bc1cf06f6c91311d8a72c9e4c3c9b81717f2b85070fbf |
|
MD5 | 4c909ff2a1519ae8bd94e1311198925a |
|
BLAKE2b-256 | 2d4385669aad95823913e448efcfb988885b51a8668ea913f95ee09947c31829 |
File details
Details for the file mykad-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: mykad-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a75d38f60cc7f2755cc716d63e53237eb34f149158f673e6b9c990bec2f664e |
|
MD5 | d26601f3618c32471422848665c55f4b |
|
BLAKE2b-256 | 68cd12e89a609c7ccf496591b065f408811f0ea473afaf5b43be72b43b9c60c5 |