diff --git a/.github/workflows/run-smoke-test.yml b/.github/workflows/run-smoke-test.yml index 43409b5..6674ef5 100755 --- a/.github/workflows/run-smoke-test.yml +++ b/.github/workflows/run-smoke-test.yml @@ -27,4 +27,3 @@ jobs: working-directory: example env: API_BASE_PATH: "https://nightly-api.regulaforensics.com" - TEST_LICENSE: ${{secrets.TEST_LICENSE}} diff --git a/example/example.py b/example/example.py index 7790e3d..020366b 100755 --- a/example/example.py +++ b/example/example.py @@ -4,12 +4,6 @@ host = os.getenv("API_BASE_PATH", "https://api.regulaforensics.com") -# read optional local license file -if os.path.isfile('regula.license') and os.access('regula.license', os.R_OK): - with open("regula.license", "rb") as f: - print("Found local license file. Using it for performing request...") - regula_license = f.read() - with open("WHITE.jpg", "rb") as f: white_page_0 = f.read() @@ -26,11 +20,6 @@ } params = ProcessParams(alreadyCropped=True, scenario=Scenario.FULLPROCESS) - # Add license to request - # request = RecognitionRequest(system_info=ProcessSystemInfo(license=base64.b64encode(regula_license).decode()), process_params=params, images=[ - # RecognitionImage(image=white_page_0, light_index=Light.WHITE, page_index=0), - # ]) - request = RecognitionRequest(process_params=params, images=[ RecognitionImage(image=white_page_0, light_index=Light.WHITE, page_index=0), # RecognitionImage(image=ir_page_0, light_index=Light.IR, page_index=0), diff --git a/regula/documentreader/webclient/gen/models/chosen_document_type.py b/regula/documentreader/webclient/gen/models/chosen_document_type.py index 445d2a4..78edd2c 100644 --- a/regula/documentreader/webclient/gen/models/chosen_document_type.py +++ b/regula/documentreader/webclient/gen/models/chosen_document_type.py @@ -21,12 +21,12 @@ class ChosenDocumentType(BaseModel): """ Contains information about one document type candidate """ # noqa: E501 - document_name: StrictStr = Field(description="Document name", alias="DocumentName") + document_name: Optional[StrictStr] = Field(default=None, description="Document name", alias="DocumentName") id: StrictInt = Field(description="Unique document type template identifier (Regula's internal numeric code)", alias="ID") p: Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]] = Field(description="A measure of the likelihood of correct recognition in the analysis of this type of document", alias="P") rotated180: StrictInt = Field(description="true if the document of the given type is rotated by 180 degrees", alias="Rotated180") rfid_presence: RfidLocation = Field(alias="RFID_Presence") - fdsid_list: FDSIDList = Field(alias="FDSIDList") + fdsid_list: Optional[FDSIDList] = Field(default=None, alias="FDSIDList") necessary_lights: StrictInt = Field(description="Combination of lighting scheme identifiers (Light enum) required to conduct OCR for this type of document", alias="NecessaryLights") check_authenticity: StrictInt = Field(description="Set of authentication options provided for this type of document (combination of Authenticity enum)", alias="CheckAuthenticity") uv_exp: StrictInt = Field(description="The required exposure value of the camera when receiving images of a document of this type for a UV lighting scheme", alias="UVExp") diff --git a/regula/documentreader/webclient/gen/models/one_candidate.py b/regula/documentreader/webclient/gen/models/one_candidate.py index 2e4eb2a..f9cab77 100644 --- a/regula/documentreader/webclient/gen/models/one_candidate.py +++ b/regula/documentreader/webclient/gen/models/one_candidate.py @@ -21,12 +21,12 @@ class OneCandidate(BaseModel): """ Contains information about one document type candidate """ # noqa: E501 - document_name: StrictStr = Field(description="Document name", alias="DocumentName") + document_name: Optional[StrictStr] = Field(default=None, description="Document name", alias="DocumentName") id: StrictInt = Field(description="Unique document type template identifier (Regula's internal numeric code)", alias="ID") p: Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]] = Field(description="A measure of the likelihood of correct recognition in the analysis of this type of document", alias="P") rotated180: StrictInt = Field(description="true if the document of the given type is rotated by 180 degrees", alias="Rotated180") rfid_presence: RfidLocation = Field(alias="RFID_Presence") - fdsid_list: FDSIDList = Field(alias="FDSIDList") + fdsid_list: Optional[FDSIDList] = Field(default=None, alias="FDSIDList") necessary_lights: StrictInt = Field(description="Combination of lighting scheme identifiers (Light enum) required to conduct OCR for this type of document", alias="NecessaryLights") check_authenticity: StrictInt = Field(description="Set of authentication options provided for this type of document (combination of Authenticity enum)", alias="CheckAuthenticity") uv_exp: StrictInt = Field(description="The required exposure value of the camera when receiving images of a document of this type for a UV lighting scheme", alias="UVExp") diff --git a/regula/documentreader/webclient/gen/models/process_params.py b/regula/documentreader/webclient/gen/models/process_params.py index 04367b7..7c1133f 100644 --- a/regula/documentreader/webclient/gen/models/process_params.py +++ b/regula/documentreader/webclient/gen/models/process_params.py @@ -98,7 +98,8 @@ class ProcessParams(BaseModel): do_barcodes: Optional[List[InputBarcodeType]] = Field(default=None, description="Set the types of barcodes to process.", alias="doBarcodes") strict_dl_category_expiry: Optional[StrictBool] = Field(default=None, description="Set to force DL categories expiry date to affect the overall status or not. As documents usually have their own date of expiry, which might be less or greater than category expiry date, this might be handy for specific cases.", alias="strictDLCategoryExpiry") generate_alpha2_codes: Optional[StrictBool] = Field(default=None, description="Set to generate Alpha-2 codes for nationality and issuing state fields.", alias="generateAlpha2Codes") - __properties: ClassVar[List[str]] = ["generateDTCVC", "lcidFilter", "checkLiveness", "lcidIgnoreFilter", "oneShotIdentification", "useFaceApi", "faceApi", "doDetectCan", "imageOutputMaxHeight", "imageOutputMaxWidth", "scenario", "resultTypeOutput", "doublePageSpread", "generateDoublePageSpreadImage", "fieldTypesFilter", "dateFormat", "measureSystem", "imageDpiOutMax", "alreadyCropped", "customParams", "config", "log", "logLevel", "forceDocID", "matchTextFieldMask", "fastDocDetect", "updateOCRValidityByGlare", "checkRequiredTextFields", "returnCroppedBarcode", "imageQa", "strictImageQuality", "respectImageQuality", "forceDocFormat", "noGraphics", "depersonalizeLog", "multiDocOnImage", "shiftExpiryDate", "minimalHolderAge", "returnUncroppedImage", "mrzFormatsFilter", "forceReadMrzBeforeLocate", "parseBarcodes", "convertCase", "splitNames", "disablePerforationOCR", "documentGroupFilter", "processAuth", "deviceId", "deviceType", "deviceTypeHex", "ignoreDeviceIdFromImage", "documentIdList", "rfid", "checkAuth", "authParams", "mrzDetectMode", "generateNumericCodes", "strictBarcodeDigitalSignatureCheck", "selectLongestNames", "doBarcodes", "strictDLCategoryExpiry", "generateAlpha2Codes"] + pdf_pages_limit: Optional[StrictInt] = Field(default=None, description="Limits the number of pages to be processed from a PDF file.", alias="pdfPagesLimit") + __properties: ClassVar[List[str]] = ["generateDTCVC", "lcidFilter", "checkLiveness", "lcidIgnoreFilter", "oneShotIdentification", "useFaceApi", "faceApi", "doDetectCan", "imageOutputMaxHeight", "imageOutputMaxWidth", "scenario", "resultTypeOutput", "doublePageSpread", "generateDoublePageSpreadImage", "fieldTypesFilter", "dateFormat", "measureSystem", "imageDpiOutMax", "alreadyCropped", "customParams", "config", "log", "logLevel", "forceDocID", "matchTextFieldMask", "fastDocDetect", "updateOCRValidityByGlare", "checkRequiredTextFields", "returnCroppedBarcode", "imageQa", "strictImageQuality", "respectImageQuality", "forceDocFormat", "noGraphics", "depersonalizeLog", "multiDocOnImage", "shiftExpiryDate", "minimalHolderAge", "returnUncroppedImage", "mrzFormatsFilter", "forceReadMrzBeforeLocate", "parseBarcodes", "convertCase", "splitNames", "disablePerforationOCR", "documentGroupFilter", "processAuth", "deviceId", "deviceType", "deviceTypeHex", "ignoreDeviceIdFromImage", "documentIdList", "rfid", "checkAuth", "authParams", "mrzDetectMode", "generateNumericCodes", "strictBarcodeDigitalSignatureCheck", "selectLongestNames", "doBarcodes", "strictDLCategoryExpiry", "generateAlpha2Codes", "pdfPagesLimit"] model_config = ConfigDict( populate_by_name=True, @@ -231,7 +232,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "selectLongestNames": obj.get("selectLongestNames"), "doBarcodes": obj.get("doBarcodes"), "strictDLCategoryExpiry": obj.get("strictDLCategoryExpiry"), - "generateAlpha2Codes": obj.get("generateAlpha2Codes") + "generateAlpha2Codes": obj.get("generateAlpha2Codes"), + "pdfPagesLimit": obj.get("pdfPagesLimit") }) return _obj diff --git a/regula/documentreader/webclient/gen/models/text_field_type.py b/regula/documentreader/webclient/gen/models/text_field_type.py index f0f3310..42901c7 100644 --- a/regula/documentreader/webclient/gen/models/text_field_type.py +++ b/regula/documentreader/webclient/gen/models/text_field_type.py @@ -662,6 +662,9 @@ class TextFieldType(int, Enum): EF_CARD_ACCESS = 692 SHORT_FLIGHT_NUMBER = 693 AIRLINE_CODE = 694 + FT_MVC_AGENCY = 695 + FT_ISSUING_STATE_CODE_ALPHA2 = 696 + FT_NATIONALITY_CODE_ALPHA2 = 697 @classmethod def from_json(cls, json_str: str) -> Self: