Skip to content

Instantly share code, notes, and snippets.

@rishabhc32
Created December 3, 2020 14:56
Show Gist options
  • Save rishabhc32/3e6b4fcda62d984033cf62962b31bc39 to your computer and use it in GitHub Desktop.
Save rishabhc32/3e6b4fcda62d984033cf62962b31bc39 to your computer and use it in GitHub Desktop.
Mock PAN extraction library
from random import randrange
class BackendError(Exception):
pass
def get_pan_data(pan_number):
num = randrange(10)
if num in (8,9):
raise BackendError
return {
'pan': pan_number,
'name': 'Dinesh Kumar',
'dob': '25-10-1990',
'father_name': 'Hari Kumar'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment