International ID V2

Sample Code:

from mindee import Client, product, AsyncPredictResponse

# Init a new client
mindee_client = Client(api_key="my-api-key")

# Load a file from disk
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")

# Load a file from disk and enqueue it.
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
    product.InternationalIdV2,
    input_doc,
)

# Print a brief summary of the parsed data
print(result.document)
class InternationalIdV2(raw_prediction)

International ID API version 2 inference prediction.

Parameters:

raw_prediction (Dict[str, Any]) –

static get_endpoint_info(klass)

Retrives the endpoint information for an Inference.

Should never retrieve info for CustomV1, as a custom endpoint should be created to use CustomV1.

Parameters:

klass (Type[Inference]) – product subclass to access endpoint information.

Return type:

Dict[str, str]

endpoint_name: Optional[str] = 'international_id'

Name of the endpoint.

endpoint_version: Optional[str] = '2'

Version of the endpoint.

is_rotation_applied: Optional[bool]

Whether the document has had any rotation applied to it.

page_id: Optional[int]

Optional page id for page-level predictions.

pages: List[Page[InternationalIdV2Document]]

Page-level prediction(s).

prediction: InternationalIdV2Document

Document-level prediction.

product: Product

Name and version of a given product, as sent back by the API.

class InternationalIdV2Document(raw_prediction, page_id=None)

International ID API version 2.1 document data.

Parameters:
  • raw_prediction (Dict[str, Any]) –

  • page_id (Optional[int]) –

address: StringField

The physical address of the document holder.

birth_date: DateField

The date of birth of the document holder.

birth_place: StringField

The place of birth of the document holder.

country_of_issue: StringField

The country where the document was issued.

document_number: StringField

The unique identifier assigned to the document.

document_type: ClassificationField

The type of personal identification document.

expiry_date: DateField

The date when the document becomes invalid.

given_names: List[StringField]

The list of the document holder’s given names.

issue_date: DateField

The date when the document was issued.

mrz_line1: StringField

The Machine Readable Zone, first line.

mrz_line2: StringField

The Machine Readable Zone, second line.

mrz_line3: StringField

The Machine Readable Zone, third line.

nationality: StringField

The country of citizenship of the document holder.

personal_number: StringField

The unique identifier assigned to the document holder.

sex: StringField

The biological sex of the document holder.

state_of_issue: StringField

The state or territory where the document was issued.

surnames: List[StringField]

The list of the document holder’s family names.