Skip to content

beeflow/python_pesel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PESEL tools

Validates PESEL number and returns date of birth and gender

Usage

First install all requirements

$ python3.8 -m pip install -r requirements.txt

How to validate PESEL

from validator import validate_pesel, ValidationError

try:
    validate_pesel('98050169129')
except ValidationError as error:
     print(error)

How to get date of birth and gender from PESEL

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

Testing

Unittest

$ python3.8 -m unittest

Prospector

$ python3.8 -m prospector --without-tool pyflakes

About

Pesel validator in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages