Validates PESEL number and returns date of birth and gender
First install all requirements
$ python3.8 -m pip install -r requirements.txtfrom validator import validate_pesel, ValidationError
try:
validate_pesel('98050169129')
except ValidationError as error:
print(error)If you want to get data of birth and / or gender, you do not have to validate PESEL first.
PeselInformation class validates it in the constructor.
from pesel import Pesel
pesel = Pesel('98050169129')
date_of_birth = pesel.get_date_of_birth()
gender = pesel.get_gender()$ python3.8 -m unittest$ python3.8 -m prospector --without-tool pyflakes