Using PIP Python Package

iApp Technology just released a PIP Python Package on Thai IDCard Photocopied 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 Thai IDCard Photocopied OCR API (รองรับเฉพาะ JPG, JPEG, PNG file ขนาด 800px x 800px - 4000px x 4000px, ขนาดไฟล์ไม่เกิน 2MB)

# IDCard Photocopied OCR required a file path
api.idcard_front_photocopied(file_path="media/copy_of_thai_idcard_trial.png").json()

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)

# IDCard Photocopied OCR required a file path

result = api.idcard_front_photocopied(file_path="media/copy_of_thai_idcard_trial.png").json()
print(result)

# {
# 'address_alley': '', 
# 'address_district': 'บางละมุง', 
# 'address_full': '33/349 หมู่ที่ 7 ต.หนองปรือ อ.บางละมุง จ.ชลบุรี',
# 'address_house_no': '33/349', 
# 'address_lane': '', 
# 'address_number': '33/349 หมู่ที่ 7',
# 'address_postal_code': '20150', 
# 'address_province': 'ชลบุรี', 
# 'address_road': '', 
# 'address_subdistrict': 'หนองปรือ',
# 'address_village': '',
# 'address_village_no': '7',
# 'date_of_birth': '1957/03/22',
# 'date_of_expire': '2025/03/21',
# 'date_of_issue': '2016/07/26',
# 'error_detail': 'successfully performed ocr',
# 'file_name_id_card': 'copy_of_thai_idcard_trial.png',
# 'fullname_en': 'Mrs. Bunyang Lopez',
# 'fullname_th': 'นาง บุญยัง โลเปช',
# 'init_en': 'Mrs.',
# 'init_th': 'นาง',
# 'name_en': 'Bunyang',
# 'name_th': 'บุญยัง', 
# 'national_id': '3411700830334', 
# 'process_time': 0.71, 
# 'reason_code_api': 200, 
# 'reason_code_id_card': 1, 
# 'reason_code_id_card_national_id': 1, 
# 'reason_code_id_card_signature': 1, 
# 'request_id': '3a863a93-a5f5-4d1f-be7a-ebb1df2bf8f7#109702',
# 'surname_en': 'Lopez',
# 'surname_th': 'โลเปช'
# }

Full Example in Google Colaboratory

Last updated