docs/localized_products/ind_passport_v1
title: IND Passport - India
category: 622b805aaec68102ea7fcbc2
slug: ruby-ind-passport—india-ocr
parentDoc: 67b49e29a2cd6f08d69a40d8
The Ruby Client Library supports the Passport - India API.
> 📝 Product Specs
>
> | Specification | Details |
> | —————————— | ————————————————– |
> | Endpoint Name | ind_passport
|
> | Recommended Version | v1.2
|
> | Supports Polling/Webhooks | ✔️ Yes |
> | Support Synchronous HTTP Calls | ❌ No |
> | Geography | 🇮🇳 India |
> 🔐 Polling Limitations
>
> | Setting | Parameter name | Default Value |
> | ——————————- | ———————– | ————- |
> | Initial Delay Before Polling | initial_delay_seconds
| 2 seconds |
> | Default Delay Between Calls | delay_sec
| 1.5 seconds |
> | Polling Attempts Before Timeout | max_retries
| 80 retries |
Using the sample below,
we are going to illustrate how to extract the data that we want using the Ruby Client Library.
Quick-Start
# # Install the Ruby client library by running: # gem install mindee # require 'mindee' # Init a new client mindee_client = Mindee::Client.new(api_key: 'my-api-key') # Load a file from disk input_source = mindee_client.source_from_path('/path/to/the/file.ext') # Parse the file result = mindee_client.parse( input_source, Mindee::Product::IND::IndianPassport::IndianPassportV1 ) # Print a full summary of the parsed data in RST format puts result.document # Print the document-level parsed data # puts result.document.inference.prediction
Output (RST):
######## Document ######## :Mindee ID: cf88fd43-eaa1-497a-ba29-a9569a4edaa7 :Filename: default_sample.jpg Inference ######### :Product: mindee/ind_passport v1.0 :Rotation applied: Yes Prediction ========== :Page Number: 1 :Country: IND :ID Number: J8369854 :Given Names: JOCELYN MICHELLE :Surname: DOE :Birth Date: 1959-09-23 :Birth Place: GUNDUGOLANU :Issuance Place: HYDERABAD :Gender: F :Issuance Date: 2011-10-11 :Expiry Date: 2021-10-10 :MRZ Line 1: P Note: a classification field's `value is always a `String`. ### Date Field Aside from the basic `Field` attributes, the date field `DateField` also implements the following: * **date_object** (`Date`): an accessible representation of the value as a JavaScript object. ### String Field The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). # Attributes The following fields are extracted for Passport - India V1: ## Address Line 1 **address1** ([StringField](#string-field)): The first line of the address of the passport holder. ```rb puts result.document.inference.prediction.address1.value
Address Line 2
address2 (StringField): The second line of the address of the passport holder.
puts result.document.inference.prediction.address2.value
Address Line 3
address3 (StringField): The third line of the address of the passport holder.
puts result.document.inference.prediction.address3.value
Birth Date
birth_date (DateField): The birth date of the passport holder, ISO format: YYYY-MM-DD.
puts result.document.inference.prediction.birth_date.value
Birth Place
birth_place (StringField): The birth place of the passport holder.
puts result.document.inference.prediction.birth_place.value
Country
country (StringField): ISO 3166-1 alpha-3 country code (3 letters format).
puts result.document.inference.prediction.country.value
Expiry Date
expiry_date (DateField): The date when the passport will expire, ISO format: YYYY-MM-DD.
puts result.document.inference.prediction.expiry_date.value
File Number
file_number (StringField): The file number of the passport document.
puts result.document.inference.prediction.file_number.value
Gender
gender (ClassificationField): The gender of the passport holder.
Possible values include:
- ‘M’
- ‘F’
puts result.document.inference.prediction.gender.value
Given Names
given_names (StringField): The given names of the passport holder.
puts result.document.inference.prediction.given_names.value
ID Number
id_number (StringField): The identification number of the passport document.
puts result.document.inference.prediction.id_number.value
Issuance Date
issuance_date (DateField): The date when the passport was issued, ISO format: YYYY-MM-DD.
puts result.document.inference.prediction.issuance_date.value
Issuance Place
issuance_place (StringField): The place where the passport was issued.
puts result.document.inference.prediction.issuance_place.value
Legal Guardian
legal_guardian (StringField): The name of the legal guardian of the passport holder (if applicable).
puts result.document.inference.prediction.legal_guardian.value
MRZ Line 1
mrz1 (StringField): The first line of the machine-readable zone (MRZ) of the passport document.
puts result.document.inference.prediction.mrz1.value
MRZ Line 2
mrz2 (StringField): The second line of the machine-readable zone (MRZ) of the passport document.
puts result.document.inference.prediction.mrz2.value
Name of Mother
name_of_mother (StringField): The name of the mother of the passport holder.
puts result.document.inference.prediction.name_of_mother.value
Name of Spouse
name_of_spouse (StringField): The name of the spouse of the passport holder (if applicable).
puts result.document.inference.prediction.name_of_spouse.value
Old Passport Date of Issue
old_passport_date_of_issue (DateField): The date of issue of the old passport (if applicable), ISO format: YYYY-MM-DD.
puts result.document.inference.prediction.old_passport_date_of_issue.value
Old Passport Number
old_passport_number (StringField): The number of the old passport (if applicable).
puts result.document.inference.prediction.old_passport_number.value
Old Passport Place of Issue
old_passport_place_of_issue (StringField): The place of issue of the old passport (if applicable).
puts result.document.inference.prediction.old_passport_place_of_issue.value
Page Number
page_number (ClassificationField): The page number of the passport document.
Possible values include:
- ‘1’
- ‘2’
puts result.document.inference.prediction.page_number.value
Surname
surname (StringField): The surname of the passport holder.
puts result.document.inference.prediction.surname.value