Carte Nationale d’Identité V2
Sample Code:
#
# Install the Python client library by running:
# pip install mindee
#
from mindee.v1 import Client, PredictResponse, product
from mindee import PathInput
# Init a new client
mindee_client = Client(api_key="my-api-key")
# Load a file from disk
input_doc = PathInput("/path/to/the/file.ext")
# Load a file from disk and parse it.
result: PredictResponse = mindee_client.parse(
product.fr.IdCardV2,
input_doc,
)
# Print a summary of the API result
print(result.document)
# Print the document-level summary
# print(result.document.inference.prediction)
- class IdCardV2(raw_prediction)
Carte Nationale d’Identité API version 2 inference prediction.
- Parameters:
raw_prediction (dict[str, Any])
- static get_endpoint_info(klass)
Retrieves 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: str | None = 'idcard_fr'
Name of the endpoint.
- endpoint_version: str | None = '2'
Version of the endpoint.
- is_rotation_applied: bool | None
Whether the document has had any rotation applied to it.
- page_id: int | None
Optional page id for page-level predictions.
- pages: list[Page[IdCardV2Page]]
Page-level prediction(s).
- prediction: IdCardV2Document
Document-level prediction.
- class IdCardV2Document(raw_prediction, page_id=None)
Carte Nationale d’Identité API version 2.0 document data.
- Parameters:
raw_prediction (dict[str, Any])
page_id (int | None)
- alternate_name: StringField
The alternate name of the card holder.
- authority: StringField
The name of the issuing authority.
- birth_place: StringField
The place of birth of the card holder.
- card_access_number: StringField
The card access number (CAN).
- document_number: StringField
The document number.
- gender: StringField
The gender of the card holder.
- given_names: list[StringField]
The given name(s) of the card holder.
- mrz1: StringField
The Machine Readable Zone, first line.
- mrz2: StringField
The Machine Readable Zone, second line.
- mrz3: StringField
The Machine Readable Zone, third line.
- nationality: StringField
The nationality of the card holder.
- surname: StringField
The surname of the card holder.
- class IdCardV2Page(raw_prediction, page_id=None)
Carte Nationale d’Identité API version 2.0 page data.
- Parameters:
raw_prediction (dict[str, Any])
page_id (int | None)
- alternate_name: StringField
The alternate name of the card holder.
- authority: StringField
The name of the issuing authority.
- birth_place: StringField
The place of birth of the card holder.
- card_access_number: StringField
The card access number (CAN).
- document_number: StringField
The document number.
- document_side: ClassificationField
The sides of the document which are visible.
- document_type: ClassificationField
The document type or format.
- gender: StringField
The gender of the card holder.
- given_names: list[StringField]
The given name(s) of the card holder.
- mrz1: StringField
The Machine Readable Zone, first line.
- mrz2: StringField
The Machine Readable Zone, second line.
- mrz3: StringField
The Machine Readable Zone, third line.
- nationality: StringField
The nationality of the card holder.
- surname: StringField
The surname of the card holder.