-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathid.py
31 lines (25 loc) · 841 Bytes
/
id.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# libraries
# import cv2
# from matplotlib import pyplot
# import numpy
from helpers import GetName, GetDates, GetID, Gender, GetPOB, GetPIA, FormatDate, Age, Validity
from scan import result, places, strr
# Use helpers functions to extract useful data
names = GetName(strr[0])
idno = GetID(strr[-1])
dates = GetDates(strr[-1])
gender = Gender(strr[-1])
pob = GetPOB(places)
pia = GetPIA(places)
# Output Data
print(f"Surname: {names[0]}")
print(f"Other Names: {names[1]} {names[2]}")
print(f"Gender: {gender}")
print(f"D.O.B: {FormatDate(dates)['dob']}")
print(f"{Age(dates['dob'])} Years")
print(f"P.O.B: {pob}\nIssuing Authority: {pia}")
print(f"Passport Number: {idno}")
if Validity(dates['exp']) == True:
print(f"Valid. Expires: {FormatDate(dates)['exp']}")
else:
print(f"Expired: {FormatDate(dates)['exp']}")