sixe_idp package

Client

class sixe_idp.api.Client(region=None, token=None)[source]
__init__(region=None, token=None)[source]

Initializes the IDP Client

Parameters
  • token (str) – Client’s token

  • region – IDP Region to make requests to, e.g. ‘test’

Returns

Client

Return type

sixe_idp.api.Client

extraction_task

An ExtractionTaskClient object

class sixe_idp.api.ExtractionTaskClient(token=None, region=None)[source]
create(file=None, file_type=None, lang=None, customer=None, customer_param=None, callback=None, auto_callback=None, callback_mode=None, hitl=None) sixe_idp.api.Task[source]
Parameters
  • lang (str) – English: EN, Default is EN

  • file (file) – Pdf/image file. Only one file is allowed to be uploaded each time

  • file_type (FileType) – The code of the file type (e.g., CBKS). Please see details of File Type Code.

  • customer (str) – Enterprise/customer code (e.g., ABCD). a fixed value provided by 6E.

  • customer_param (str) – Any value in string specified by customer enterprise/customer. This value will return in callback request.

  • callback (str) – A http(s) link for callback after completing the task. If you need to use the callback parameter, please make sure that the callback url does not have any authentication.

  • auto_callback (bool) – Callback request will request automatic if autoCallback is true, otherwise, the user needs to manually trigger the callback.Default value is true.

  • callback_mode (int) –

    Callback mode when the task finishes.

    • mode 0: callback request only contains the task status.

    • mode 1: callback request contains task status and extracted field results.

    • mode 2: callback request contains task status, extracted fields results and pdf file.

    Default is 0.

  • hitl (bool) – Enables the Human-In-The-Loop (HITL) service. If the value is true, the submitted task will be processed by AI + HITL. Otherwise, the task will be processed by AI only. Default value: false.

result(task_id=None) sixe_idp.api.TaskResult[source]
Parameters

task_id (int) – task_id

Returns

status and result of task

Return type

TaskResult

run_simple_task(file=None, file_type=None, poll_interval=3, timeout=600)[source]

Run simple extraction task

Parameters
  • file (file) – Pdf/image file. Only one file is allowed to be uploaded each time

  • file_type (FileType) – The code of the file type (e.g., CBKS). Please see details of File Type Code.

  • poll_interval (float) – Interval to poll the result from api, in seconds

  • timeout (float) – Timeout in seconds

Data

class sixe_idp.api.Task(raw=None)[source]

The Task object, which contains a server’s response to an IDP task creating request.

property task_id
class sixe_idp.api.TaskResult(raw)[source]
property fields

List of TaskResultField object

property status

status of the task, which can be:

  • Init Task is created

  • Doing Task is being processed

  • Done Task result is avaiable

  • Fail An error occurred

  • Invalid Invalid document

read more

class sixe_idp.api.TaskResultField(raw)[source]
property field_code

see field_code

property field_name

see field_name

property type

see type

property value

Constants

class sixe_idp.api.FileType(value)[source]

An enumeration.

air_waybill = 'AWBL'
bank_statement = 'CBKS'
bill_of_lading = 'BL'
cheque = 'CHQ'
credit_bureau_singapore = 'CBS'
delivery_order = 'DO'
hong_kong_annual_return = 'HKAR'
invoice = 'CINV'
kartu_tanda_penduduk = 'KTP'
packing_list = 'PL'
payslip = 'PS'
purchase_order = 'PO'
receipt = 'RCPT'

Exceptions

class sixe_idp.api.IDPException[source]

An IDP processing error occurred.

class sixe_idp.api.IDPConfigurationException[source]

An IDP configuration error occurred.