Package: idanalyzer2
ID Analyzer Python SDKThis is a python SDK library forID Analyzer Identity Verification APIs, though all the APIs can be called with without the SDK using simple HTTP requests as outlined in thedocumentation, you can use this SDK to accelerate server-side development.We strongly discourage users to connect to ID Analyzer API endpoint directly from client-side applications that will be distributed to end user, such as mobile app, or in-browser JavaScript. Your API key could be easily compromised, and if you are storing your customer's information inside Vault they could use your API key to fetch all your user details. Therefore, the best practice is always to implement a client side connection to your server, and call our APIs from the server-side.InstallationInstall through PIPpipinstallidanalyzerScannerThis category supports all scanning-related functions specifically used to initiate a new identity document scan & ID face verification transaction by uploading based64-encoded images.fromidanalyzer2import*importtracebackimportjsontry:profile=Profile(Profile.SECURITY_MEDIUM)s=Scanner('CBoQpSfkRcPvUhstucIPfiGNLPVuwB23')s.throwApiException(True)resp=s.quickScan('05.png',"",True)withopen('quickScan.json','w')asf:f.write(json.dumps(resp,indent=4))s.setProfile(profile)resp=s.scan("05.png")withopen('scan.json','w')asf:f.write(json.dumps(resp,indent=4))exceptAPIErrorase:print(traceback.format_exc())print(e.args[0])exceptInvalidArgumentExceptionase:print(traceback.format_exc())print(e.args[0])exceptExceptionase:print(traceback.format_exc())print(e.args[0])BiometricThere are two primary functions within this class. The first one is verifyFace and the second is verifyLiveness.fromidanalyzer2import*importtracebackimportjsontry:profile=Profile(Profile.SECURITY_MEDIUM)b=Biometric('CBoQpSfkRcPvUhstucIPfiGNLPVuwB23')b.throwApiException(True)b.setProfile(profile)resp=b.verifyFace('05.png','05.png')withopen('verifyFace.json','w')asf:f.write(json.dumps(resp,indent=4))resp=b.verifyLiveness('05.png','05.png')withopen('verifyLiveness.json','w')asf:f.write(json.dumps(resp,indent=4))exceptAPIErrorase:print(traceback.format_exc())print(e.args[0])exceptInvalidArgumentExceptionase:print(traceback.format_exc())print(e.args[0])exceptExceptionase:print(traceback.format_exc())print(e.args[0])ContractAll contract-related feature sets are available in Contract class. There are three primary functions in this class.fromidanalyzer2import*importtracebackimportjsontry:c=Contract('CBoQpSfkRcPvUhstucIPfiGNLPVuwB23')c.throwApiException(True)temp=c.createTemplate("tempName","<p>%{fullName}</p>")withopen('createTemplate.json','w')asf:f.write(json.dumps(temp,indent=4))tempId=temp['templateId']resp=c.updateTemplate(tempId,"oldTemp","<p>%{fullName}</p><p>Hello!!</p>")withopen('updateTemplate.json','w')asf:f.write(json.dumps(resp,indent=4))resp=c.getTemplate(tempId)withopen('getTemplate.json','w')asf:f.write(json.dumps(resp,indent=4))resp=c.listTemplate()withopen('listTemplate.json','w')asf:f.write(json.dumps(resp,indent=4))resp=c.generate(tempId,"PDF","",{'fullName':"Tian",})withopen('generate.json','w')asf:f.write(json.dumps(resp,indent=4))resp=c.deleteTemplate(tempId)withopen('deleteTemplate.json','w')asf:f.write(json.dumps(resp,indent=4))exceptAPIErrorase:print(traceback.format_exc())print(e.args[0])exceptInvalidArgumentExceptionase:print(traceback.format_exc())print(e.args[0])exceptExceptionase:print(traceback.format_exc())print(e.args[0])DocupassThis category supports all rapid user verification based on the ids and the face images provided.fromidanalyzer2import*importtracebackimportjsontry:d=Docupass('CBoQpSfkRcPvUhstucIPfiGNLPVuwB23')d.throwApiException(True)doc=d.createDocupass("bbd8436953ef426e98d078953f258835")withopen('createDocupass.json','w')asoutfile:json.dump(doc,outfile)resp=d.listDocupass()withopen('listDocupass.json','w')asoutfile:json.dump(resp,outfile)resp=d.deleteDocupass(doc['reference'])withopen('deleteDocupass.json','w')asoutfile:json.dump(resp,outfile)exceptAPIErrorase:print(traceback.format_exc())print(e.args[0])exceptInvalidArgumentExceptionase:print(traceback.format_exc())print(e.args[0])exceptExceptionase:print(traceback.format_exc())print(e.args[0])TransactionThis function enables the developer to retrieve a single transaction record based on the provided transactionId.fromidanalyzer2import*importtracebackimportjsontry:t=Transaction('CBoQpSfkRcPvUhstucIPfiGNLPVuwB23')t.throwApiException(True)tid="da3124d09173474cabc86f3a648c9084"resp=t.getTransaction(tid)withopen('getTransaction.json','w')asf:f.write(json.dumps(resp,indent=4))resp=t.listTransaction()withopen('listTransaction.json','w')asf:f.write(json.dumps(resp,indent=4))resp=t.updateTransaction(tid,"review")withopen('updateTransaction.json','w')asf:f.write(json.dumps(resp,indent=4))resp=t.deleteTransaction(tid)withopen('deleteTransaction.json','w')asf:f.write(json.dumps(resp,indent=4))t.saveImage("fb2079b309c116b025408b2b79f90b9c196b02a27827ba98ea1ddc2af63f111c","test.jpg")t.saveFile("testsign_3smMjY66x4y7CVPNrbBRGyKoePrlW8oi.pdf","test.pdf")t.exportTransaction("./test.zip",["305e9fcb7b7a48dbab7c87d3a752b5e1",],"json")exceptAPIErrorase:print(traceback.format_exc())print(e.args[0])exceptInvalidArgumentExceptionase:print(traceback.format_exc())print(e.args[0])exceptExceptionase:print(traceback.format_exc())print(e.args[0])Api DocumentID Analyzer DocumentDemoCheck out/demofolder for more Python demos.SDK ReferenceCheck outID Analyzer Python Reference