Skip to main content

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 and gender.

screenshot

The MyKad class

from mykad.mykad import MyKad

mykad = MyKad(MYKAD_NUMBER)

The following methods are included in the MyKad class:

Method Comment
get_unformatted() Gets the unformatted MyKad string.
get_formatted() Gets the formatted MyKad string.
is_male() Checks if the MyKad holder is a male.
is_female() Checks if the MyKad holder is a female.

The following attributes are included in the MyKad class:

Attribute Comment
birthdate Gets the datetime instance corresponding to the MyKad holder's birthdate.
birth_year Gets the birth year of the MyKad holder.
birth_month Gets the birth month of the MyKad holder.
day_of_birth Gets the day of birth of the MyKad holder.
birthplace Gets the birthplace of the MyKad holder.
gender Gets the gender of the MyKad holder.

Included utility functions

The following utility functions are included under mykad.utils:

Utility Comment
is_mykad_valid Checks if a MyKad is valid.
get_birthplace Quickly check the birthplace corresponding to a birthplace code.
get_state_abbreviation Gets the state abbreviation

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.3.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

mykad-0.3.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file mykad-0.3.0.tar.gz.

File metadata

  • Download URL: mykad-0.3.0.tar.gz
  • Upload date:
  • Size: 4.7 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.1 CPython/3.8.5

File hashes

Hashes for mykad-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0eb8b5f47fff0ff2ebdd80e7aa49fe9eabc391d538a920eecf5085f1084b97ad
MD5 308973799178521d466ddf5d82c71f46
BLAKE2b-256 0acc0ca7fa069132a1bd0ef1d2cf5a3178b4ae10c804e1d808076af2b138bf2a

See more details on using hashes here.

File details

Details for the file mykad-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mykad-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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.1 CPython/3.8.5

File hashes

Hashes for mykad-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1501750b7f8ff684bb981ca071d86cfba0977bd42e4007ad444344c6534b5479
MD5 09cfef4865cadc3877dd1534ce0119d2
BLAKE2b-256 ef43e14e7700650581198eeadea24d620b5eb03e1472ed8d793673e1a8306727

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page