Using PIP Python Package

iApp Technology just released a PIP Python Package on Passport OCR.

For easing the python development using iApp AI API service, we have released the iapp_ai python pip package. It is the api client library for iApp AI API service for python.

Installation

$ pip install iapp_ai

Note: It can be either pip or pip3 depend on your environment.

Calling Passport OCR API

# api required a file path
api.passport_ocr("media/ukr-passport.jpeg")

Example Usages

import iapp_ai


# You can request API key at https://ai.iapp.co.th
apikey = 'XXXXX_Your_API_Key_XXXXX' 

api = iapp_ai.api(apikey)

# api required a file path.

result = api.passport_ocr("media/ukr-passport.jpeg").json()
print(result)

# {
# 'check_composite': '0', 
# 'check_date_of_birth': '2', 
# 'check_expiration_date': '7', 
# 'check_number': '0',
# 'check_personal_number': '7', 
# 'country': 'UKR', 
# 'date_of_birth': '910824', 
# 'expiration_date': '230925', 
# 'face':  ...
# }

Full Example in Google Colaboratory

Last updated