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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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