Skip to main content

This library is built to ease the process of decoding aadhaar QR codes and XML. It supprts old aadhaar QR codes , newly released Secure aadhaar QR codes and also Offline e-KYC XML. This library also can decode QR codes with Opncv. This library bundled with all the features to verify user's Email Id and Mobile Number & also to extract the photo of user.

Project description

PyAadhaar Library


Designed to decode Aadhaar Old QR Code , Secure QR Code and also Offline XML


|| Decode New Adhaar Secure QR Code ||


=> Initialize Object & Print Decoded Data

from pyaadhaar.decode import AadhaarSecureQr

obj  = AadhaarSecureQr(<:Data got from QR:>)
print(obj.decodeddata())

Output :

{'email_mobile_status': '2',
'referenceid': '345642020107890441252',
'name': 'X Das',
'dob': '01-01-2000',
'gender': 'F',
'careof': 'C/O: Y Das',
'district': 'Nadia',
'landmark': 'Primary School',
'house': 'N0456',
'location': 'Taherpur',
'pincode': '741159',
'postoffice': 'Taherpur',
'state': 'West Bengal',
'street': 'Taherpur Road',
'subdistrict': 'Ranaghat - I',
'vtc': 'Taherpur ',
'adhaar_last_4_digit': '3456',
'adhaar_last_digit': '6',
'email': 'no',
'mobile': 'yes'}

=> Verify Email Id Or Mobile

print(obj.verifyEmail("example@gmail.com"))
print(obj.verifyMobileNumber(9999999999))

Output :

True  # True if Email Verified
False # True if Mobile Number Verified

=> Check for Email Id Or Mobile Registration

print(obj.isEmailRegistered("example@gmail.com"))
print(obj.isMobileNoRegistered(9999999999))

Output :

True  # True if Email Registered
False # True if Mobile Number Registered

=> Get The Image Of User

image = obj.image()

=> Save The Image Of User

obj.saveimage("filename.jpg")

=> Get SHA256 Hash of Email

print(obj.sha256hashOfEMail())

Output :

d5598a28a82666c7ed9978h8936851189c494c84e62ab9782492fd038d9cb328

=> Get SHA256 Hash of Mobile Number

print(obj.sha256hashOfMobileNumber())

Output :

15a79565f9f1880e94dc62de51o9j7bd08542e7a6df82081ce1e72f0fb199e69


|| Decode Old Adhaar QR Code ||


=> Initialize Object & Print Decoded Data

from pyaadhaar.decode import AadhaarOldQr

obj  = AadhaarOldQr(<:Data got from QR:>)
print(obj.decodeddata())

Output :

{'uid': '6XXXXXXXX789',
 'name': 'X Sarkar',
 'gender': 'M',
 'yob': '2001',
 'gname': 'Y Sarkar',
 'street': 'TAHERPUR ROAD',
 'lm': 'TAHERPUR',
 'loc': '-',
 'vtc': 'Taherpur (P)',
 'po': 'Taherpur',
 'dist': 'Nadia',
 'subdist': 'Ranaghat - I',
 'state': 'West Bengal',
 'pc': '741159',
 'dob': '01/01/2001'}


|| Decode Adhaar Offline e-KYC XML ||


=> Initialize Object & Print Decoded Data

from pyaadhaar.decode import AadhaarOfflineXML

obj  = AadhaarOfflineXML(<:Offline e-KYC XML ZIP:>,<Passcode>)
print(obj.decodeddata())

Output :

{'email_mobile_status': '2',
'referenceid': '345642020107890441252',
'name': 'X Das',
'dob': '01-01-2000',
'gender': 'F',
'careof': 'C/O: Y Das',
'district': 'Nadia',
'landmark': 'Primary School',
'house': 'N0456',
'location': 'Taherpur',
'pincode': '741159',
'postoffice': 'Taherpur',
'state': 'West Bengal',
'street': 'Taherpur Road',
'subdistrict': 'Ranaghat - I',
'vtc': 'Taherpur ',
'adhaar_last_4_digit': '3456',
'adhaar_last_digit': '6',
'email': 'no',
'mobile': 'yes'}

=> Verify Email Id Or Mobile

print(obj.verifyEmail("example@gmail.com"))
print(obj.verifyMobileNumber(9999999999))

Output :

True  # True if Email Verified
False # True if Mobile Number Verified

=> Check for Email Id Or Mobile Registration

print(obj.isEmailRegistered("example@gmail.com"))
print(obj.isMobileNoRegistered(9999999999))

Output :

True  # True if Email Registered
False # True if Mobile Number Registered

=> Get The Image Of User

image = obj.image()

=> Save The Image Of User

obj.saveimage("filename.jpg")

=> Get SHA256 Hash of Email

print(obj.sha256hashOfEMail())

Output :

d5598a28a82666c7ed9978h8936851189c494c84e62ab9782492fd038d9cb328

=> Get SHA256 Hash of Mobile Number

print(obj.sha256hashOfMobileNumber())

Output :

15a79565f9f1880e94dc62de51o9j7bd08542e7a6df82081ce1e72f0fb199e69


|| Decode Image Of QR Code ||


from pyaadhaar.utils import Qr_img_to_text

print(Qr_img_to_text(<Image File Location or Image file stream>))

Output :

["google.com","amazon.in"] # Will return a list of data


|| Aadhaar Auto Initialize Class On QR code Type ||


=> Initialize


from pyaadhaar.utils import AadhaarQrAuto

obj = AadhaarQrAuto(<Aadhaar QR code Data >)
  • Then all the methods are same corresponding to
    • AadhaarOldQr
    • AadhaarSecureQr


|| Aadhaar Check Old or Secure QR Code||


=> Initialize

from pyaadhaar.utils import isSecureQr

print(isSecureQr(<Aadhaar QR code Data >))

Output :

True # If it is a new secure QR code, else False


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

pyaadhaar-1.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

pyaadhaar-1.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pyaadhaar-1.1.1.tar.gz.

File metadata

  • Download URL: pyaadhaar-1.1.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.3

File hashes

Hashes for pyaadhaar-1.1.1.tar.gz
Algorithm Hash digest
SHA256 526cbdc16ece33da5cd24963c3716f50ff90b24641f2d1edfc4c26ed3e8c85b7
MD5 7b3552963a4e92fc05fefaafb81cfcbd
BLAKE2b-256 c0e3acf5b7412155fab1dd3fb84bf60820bd98e9659f43903ef9750e5f47a395

See more details on using hashes here.

File details

Details for the file pyaadhaar-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyaadhaar-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.3

File hashes

Hashes for pyaadhaar-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51c8d4c3115b96cf46a009cedcae2d1d6700a75f6c5e73e8d552d870b2e204f0
MD5 5abddfaa92fbc0b0c6872f7c5316e3c5
BLAKE2b-256 88019d101ae1db0870b69a3b51c76289e29768b7d5b6866a0607ac8a0f788aba

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