diff --git a/.github/workflows/test-regression.yml b/.github/workflows/test-regression.yml index 9bd31c1c..220ce79f 100644 --- a/.github/workflows/test-regression.yml +++ b/.github/workflows/test-regression.yml @@ -51,9 +51,5 @@ jobs: - name: Run Regression Testing env: MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }} - uses: actions/checkout@v3 - with: - timeout_minutes: 25 - max_attempts: 2 - run: | - pytest -m regression tests + run: | + pytest -m regression tests diff --git a/docs/extras/code_samples/bank_account_details_v1.txt b/docs/extras/code_samples/bank_account_details_v1.txt index 36354173..47da27e4 100644 --- a/docs/extras/code_samples/bank_account_details_v1.txt +++ b/docs/extras/code_samples/bank_account_details_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.fr.BankAccountDetailsV1, i # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/bank_account_details_v2.txt b/docs/extras/code_samples/bank_account_details_v2.txt index 79d1cdec..e424e8bc 100644 --- a/docs/extras/code_samples/bank_account_details_v2.txt +++ b/docs/extras/code_samples/bank_account_details_v2.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.fr.BankAccountDetailsV2, i # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/bank_check_v1.txt b/docs/extras/code_samples/bank_check_v1.txt index 77785368..c2a12bb6 100644 --- a/docs/extras/code_samples/bank_check_v1.txt +++ b/docs/extras/code_samples/bank_check_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.us.BankCheckV1, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/barcode_reader_v1.txt b/docs/extras/code_samples/barcode_reader_v1.txt index d46dbc71..5a0bfd3f 100644 --- a/docs/extras/code_samples/barcode_reader_v1.txt +++ b/docs/extras/code_samples/barcode_reader_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.BarcodeReaderV1, input_doc # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/carte_grise_v1.txt b/docs/extras/code_samples/carte_grise_v1.txt index e44f3121..6bcffeec 100644 --- a/docs/extras/code_samples/carte_grise_v1.txt +++ b/docs/extras/code_samples/carte_grise_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.fr.CarteGriseV1, input_doc # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/carte_vitale_v1.txt b/docs/extras/code_samples/carte_vitale_v1.txt index 57b47857..69771ff3 100644 --- a/docs/extras/code_samples/carte_vitale_v1.txt +++ b/docs/extras/code_samples/carte_vitale_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.fr.CarteVitaleV1, input_do # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/cropper_v1.txt b/docs/extras/code_samples/cropper_v1.txt index b6acb644..271b23d8 100644 --- a/docs/extras/code_samples/cropper_v1.txt +++ b/docs/extras/code_samples/cropper_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.CropperV1, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/expense_receipts_v5.txt b/docs/extras/code_samples/expense_receipts_v5.txt index cb512f26..059c191a 100644 --- a/docs/extras/code_samples/expense_receipts_v5.txt +++ b/docs/extras/code_samples/expense_receipts_v5.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.ReceiptV5, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/financial_document_v1.txt b/docs/extras/code_samples/financial_document_v1.txt index 09316d4d..aa175aab 100644 --- a/docs/extras/code_samples/financial_document_v1.txt +++ b/docs/extras/code_samples/financial_document_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.FinancialDocumentV1, input # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/idcard_fr_v1.txt b/docs/extras/code_samples/idcard_fr_v1.txt index 783918f9..f21814d8 100644 --- a/docs/extras/code_samples/idcard_fr_v1.txt +++ b/docs/extras/code_samples/idcard_fr_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.fr.IdCardV1, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/idcard_fr_v2.txt b/docs/extras/code_samples/idcard_fr_v2.txt index 5811aac8..f37fd7ab 100644 --- a/docs/extras/code_samples/idcard_fr_v2.txt +++ b/docs/extras/code_samples/idcard_fr_v2.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.fr.IdCardV2, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/invoices_v4.txt b/docs/extras/code_samples/invoices_v4.txt index 04eb3145..06770ba7 100644 --- a/docs/extras/code_samples/invoices_v4.txt +++ b/docs/extras/code_samples/invoices_v4.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.InvoiceV4, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/license_plates_v1.txt b/docs/extras/code_samples/license_plates_v1.txt index 14af92f1..d38d47b4 100644 --- a/docs/extras/code_samples/license_plates_v1.txt +++ b/docs/extras/code_samples/license_plates_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.eu.LicensePlateV1, input_d # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/material_certificate_v1.txt b/docs/extras/code_samples/material_certificate_v1.txt index 59f37ff8..70c737f3 100644 --- a/docs/extras/code_samples/material_certificate_v1.txt +++ b/docs/extras/code_samples/material_certificate_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.MaterialCertificateV1, inp # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/multi_receipts_detector_v1.txt b/docs/extras/code_samples/multi_receipts_detector_v1.txt index 6a16410a..0f62d504 100644 --- a/docs/extras/code_samples/multi_receipts_detector_v1.txt +++ b/docs/extras/code_samples/multi_receipts_detector_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.MultiReceiptsDetectorV1, i # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/passport_v1.txt b/docs/extras/code_samples/passport_v1.txt index 4b094740..eca091cd 100644 --- a/docs/extras/code_samples/passport_v1.txt +++ b/docs/extras/code_samples/passport_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.PassportV1, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/proof_of_address_v1.txt b/docs/extras/code_samples/proof_of_address_v1.txt index d6049ea1..f6afc248 100644 --- a/docs/extras/code_samples/proof_of_address_v1.txt +++ b/docs/extras/code_samples/proof_of_address_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.ProofOfAddressV1, input_do # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/us_driver_license_v1.txt b/docs/extras/code_samples/us_driver_license_v1.txt index 2e9a3718..de29ee34 100644 --- a/docs/extras/code_samples/us_driver_license_v1.txt +++ b/docs/extras/code_samples/us_driver_license_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.us.DriverLicenseV1, input_ # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/code_samples/us_w9_v1.txt b/docs/extras/code_samples/us_w9_v1.txt index 733c5000..fbe8eabf 100644 --- a/docs/extras/code_samples/us_w9_v1.txt +++ b/docs/extras/code_samples/us_w9_v1.txt @@ -12,7 +12,3 @@ result: PredictResponse = mindee_client.parse(product.us.W9V1, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) diff --git a/docs/extras/guide/bank_account_details_v2.md b/docs/extras/guide/bank_account_details_v2.md index 2f798770..b69ddd7e 100644 --- a/docs/extras/guide/bank_account_details_v2.md +++ b/docs/extras/guide/bank_account_details_v2.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.fr.BankAccountDetailsV2, i # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -80,7 +76,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/bank_check_v1.md b/docs/extras/guide/bank_check_v1.md index a5c85f87..4307ad1d 100644 --- a/docs/extras/guide/bank_check_v1.md +++ b/docs/extras/guide/bank_check_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.us.BankCheckV1, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -80,7 +76,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/barcode_reader_v1.md b/docs/extras/guide/barcode_reader_v1.md index 41dd154d..9d4845ba 100644 --- a/docs/extras/guide/barcode_reader_v1.md +++ b/docs/extras/guide/barcode_reader_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.BarcodeReaderV1, input_doc # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -70,7 +66,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/carte_grise_v1.md b/docs/extras/guide/carte_grise_v1.md index ba12cb7e..680f7a56 100644 --- a/docs/extras/guide/carte_grise_v1.md +++ b/docs/extras/guide/carte_grise_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.fr.CarteGriseV1, input_doc # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -146,7 +142,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/carte_vitale_v1.md b/docs/extras/guide/carte_vitale_v1.md index df429a65..616df5d9 100644 --- a/docs/extras/guide/carte_vitale_v1.md +++ b/docs/extras/guide/carte_vitale_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.fr.CarteVitaleV1, input_do # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -72,7 +68,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/cropper_v1.md b/docs/extras/guide/cropper_v1.md index d0ceb40d..cd38267f 100644 --- a/docs/extras/guide/cropper_v1.md +++ b/docs/extras/guide/cropper_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.CropperV1, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -66,7 +62,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/expense_receipts_v5.md b/docs/extras/guide/expense_receipts_v5.md index ae953108..d6b4e159 100644 --- a/docs/extras/guide/expense_receipts_v5.md +++ b/docs/extras/guide/expense_receipts_v5.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.ReceiptV5, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -118,7 +114,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/financial_document_v1.md b/docs/extras/guide/financial_document_v1.md index 62b49291..00beaaa2 100644 --- a/docs/extras/guide/financial_document_v1.md +++ b/docs/extras/guide/financial_document_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.FinancialDocumentV1, input # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -72,7 +68,7 @@ Prediction :Purchase Time: 20:20 :Line Items: +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ - | Description | Product Code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price | + | Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price | +======================================+==============+==========+============+==============+==============+============+ | TAX | | | | | 3.34 | | +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ @@ -111,7 +107,7 @@ Page 0 :Purchase Time: 20:20 :Line Items: +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ - | Description | Product Code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price | + | Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price | +======================================+==============+==========+============+==============+==============+============+ | TAX | | | | | 3.34 | | +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ @@ -130,7 +126,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/idcard_fr_v2.md b/docs/extras/guide/idcard_fr_v2.md index 5337e71e..a750dd66 100644 --- a/docs/extras/guide/idcard_fr_v2.md +++ b/docs/extras/guide/idcard_fr_v2.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.fr.IdCardV2, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -98,7 +94,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/invoices_v4.md b/docs/extras/guide/invoices_v4.md index 753ee12c..b88adba7 100644 --- a/docs/extras/guide/invoices_v4.md +++ b/docs/extras/guide/invoices_v4.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.InvoiceV4, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -33,7 +29,7 @@ print(result.document) ######## Document ######## -:Mindee ID: a8718ec1-aaa9-410d-b2fc-15ab1d092c9a +:Mindee ID: 16bd8752-8c4d-450f-8213-f33b2097504c :Filename: default_sample.jpg Inference @@ -44,37 +40,36 @@ Inference Prediction ========== :Locale: en; en; CAD; -:Document Type: INVOICE :Invoice Number: 14 :Reference Numbers: AD29094 -:Invoice Date: 2018-09-25 -:Invoice Due Date: 2018-09-25 -:Supplier Name: TURNPIKE DESIGNS CO. -:Supplier Address: 156 University Ave, Toronto ON, Canada M5H 2H7 -:Supplier Company Registrations: -:Supplier Payment Details: -:Customer Name: JIRO DOI -:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada -:Customer Company Registrations: +:Purchase Date: 2018-09-25 +:Due Date: 2018-09-25 +:Total Net: +:Total Amount: 2608.20 :Taxes: +---------------+--------+----------+---------------+ | Base | Code | Rate (%) | Amount | +===============+========+==========+===============+ | | | 8.00 | 193.20 | +---------------+--------+----------+---------------+ -:Total Net: -:Total Tax: 193.20 -:Total Amount: 2608.20 +:Supplier Payment Details: +:Supplier Name: TURNPIKE DESIGNS CO. +:Supplier Company Registrations: +:Supplier Address: 156 University Ave, Toronto ON, Canada M5H 2H7 +:Customer Name: JIRO DOI +:Customer Company Registrations: +:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada +:Document Type: INVOICE :Line Items: +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ - | Description | Product Code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price | + | Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price | +======================================+==============+==========+============+==============+==============+============+ | Platinum web hosting package Down... | | 1.00 | | | 65.00 | 65.00 | +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ | 2 page website design Includes ba... | | 3.00 | | | 2100.00 | 2100.00 | +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ | Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 250.00 | - +--------------------------------------+--------------+----------+---------------------------+--------------+------------+ + +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ Page Predictions ================ @@ -82,37 +77,36 @@ Page Predictions Page 0 ------ :Locale: en; en; CAD; -:Document Type: INVOICE :Invoice Number: 14 :Reference Numbers: AD29094 -:Invoice Date: 2018-09-25 -:Invoice Due Date: 2018-09-25 -:Supplier Name: TURNPIKE DESIGNS CO. -:Supplier Address: 156 University Ave, Toronto ON, Canada M5H 2H7 -:Supplier Company Registrations: -:Supplier Payment Details: -:Customer Name: JIRO DOI -:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada -:Customer Company Registrations: +:Purchase Date: 2018-09-25 +:Due Date: 2018-09-25 +:Total Net: +:Total Amount: 2608.20 :Taxes: +---------------+--------+----------+---------------+ | Base | Code | Rate (%) | Amount | +===============+========+==========+===============+ | | | 8.00 | 193.20 | +---------------+--------+----------+---------------+ -:Total Net: -:Total Tax: 193.20 -:Total Amount: 2608.20 +:Supplier Payment Details: +:Supplier Name: TURNPIKE DESIGNS CO. +:Supplier Company Registrations: +:Supplier Address: 156 University Ave, Toronto ON, Canada M5H 2H7 +:Customer Name: JIRO DOI +:Customer Company Registrations: +:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada +:Document Type: INVOICE :Line Items: +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ - | Description | Product Code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price | + | Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit Price | +======================================+==============+==========+============+==============+==============+============+ | Platinum web hosting package Down... | | 1.00 | | | 65.00 | 65.00 | +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ | 2 page website design Includes ba... | | 3.00 | | | 2100.00 | 2100.00 | +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ | Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 250.00 | - +--------------------------------------+--------------+----------+---------------------------+--------------+------------+ + +--------------------------------------+--------------+----------+------------+--------------+--------------+------------+ ``` # Field Types @@ -128,7 +122,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/license_plates_v1.md b/docs/extras/guide/license_plates_v1.md index 03044419..2623aece 100644 --- a/docs/extras/guide/license_plates_v1.md +++ b/docs/extras/guide/license_plates_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.eu.LicensePlateV1, input_d # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -66,7 +62,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/material_certificate_v1.md b/docs/extras/guide/material_certificate_v1.md index 395f9fde..d2d980df 100644 --- a/docs/extras/guide/material_certificate_v1.md +++ b/docs/extras/guide/material_certificate_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.MaterialCertificateV1, inp # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -45,7 +41,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/multi_receipts_detector_v1.md b/docs/extras/guide/multi_receipts_detector_v1.md index b57fbf91..95fb2675 100644 --- a/docs/extras/guide/multi_receipts_detector_v1.md +++ b/docs/extras/guide/multi_receipts_detector_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.MultiReceiptsDetectorV1, i # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -76,7 +72,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/passport_v1.md b/docs/extras/guide/passport_v1.md index ac57d93a..99861a36 100644 --- a/docs/extras/guide/passport_v1.md +++ b/docs/extras/guide/passport_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.PassportV1, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -86,7 +82,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/proof_of_address_v1.md b/docs/extras/guide/proof_of_address_v1.md index 07e41f68..3c0e6f50 100644 --- a/docs/extras/guide/proof_of_address_v1.md +++ b/docs/extras/guide/proof_of_address_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.ProofOfAddressV1, input_do # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -33,12 +29,12 @@ print(result.document) ######## Document ######## -:Mindee ID: 3a7e1da6-d4d0-4704-af91-051fe5484c2e +:Mindee ID: 5d2361e9-405e-4fc1-8531-f92a3aef0c38 :Filename: default_sample.jpg Inference ######### -:Product: mindee/proof_of_address v1.0 +:Product: mindee/proof_of_address v1.1 :Rotation applied: Yes Prediction @@ -46,7 +42,7 @@ Prediction :Locale: en; en; USD; :Issuer Name: PPL ELECTRIC UTILITIES :Issuer Company Registrations: -:Issuer Address: 2 NORTH 9TH STREET CPC-GENN1 ALLENTOWN,PA 18101-1175 +:Issuer Address: 2 NORTH STH STREET CPC-GENN1 ALLENTOWN.PA 18101-1175 :Recipient Name: :Recipient Company Registrations: :Recipient Address: 123 MAIN ST ANYTOWN,PA 18062 @@ -72,7 +68,7 @@ Page 0 :Locale: en; en; USD; :Issuer Name: PPL ELECTRIC UTILITIES :Issuer Company Registrations: -:Issuer Address: 2 NORTH 9TH STREET CPC-GENN1 ALLENTOWN,PA 18101-1175 +:Issuer Address: 2 NORTH STH STREET CPC-GENN1 ALLENTOWN.PA 18101-1175 :Recipient Name: :Recipient Company Registrations: :Recipient Address: 123 MAIN ST ANYTOWN,PA 18062 @@ -104,7 +100,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/us_driver_license_v1.md b/docs/extras/guide/us_driver_license_v1.md index 626460c2..43aa943d 100644 --- a/docs/extras/guide/us_driver_license_v1.md +++ b/docs/extras/guide/us_driver_license_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.us.DriverLicenseV1, input_ # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -100,7 +96,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/extras/guide/us_w9_v1.md b/docs/extras/guide/us_w9_v1.md index 9f2a6a7a..9b54d70b 100644 --- a/docs/extras/guide/us_w9_v1.md +++ b/docs/extras/guide/us_w9_v1.md @@ -22,10 +22,6 @@ result: PredictResponse = mindee_client.parse(product.us.W9V1, input_doc) # Print a brief summary of the parsed data print(result.document) - -# # Iterate over all the fields in the document -# for field_name, field_values in result.document.inference.prediction.fields.items(): -# print(field_name, "=", field_values) ``` **Output (RST):** @@ -76,7 +72,7 @@ A typical `BaseField` object will have the following attributes: * **bounding_box** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. * **polygon** (`List[Point]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. * **page_id** (`int`): the ID of the page, is `None` when at document-level. -* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it). +* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). > **Note:** A `Point` simply refers to a List of two numbers (`[float, float]`). diff --git a/docs/product/financial_document_v1.rst b/docs/product/financial_document_v1.rst index c3edb33e..c224f132 100644 --- a/docs/product/financial_document_v1.rst +++ b/docs/product/financial_document_v1.rst @@ -16,3 +16,4 @@ Financial Document V1 .. autoclass:: mindee.product.financial_document.financial_document_v1_line_item.FinancialDocumentV1LineItem :members: + :inherited-members: diff --git a/docs/product/fr/bank_account_details_v2.rst b/docs/product/fr/bank_account_details_v2.rst index 7ead6344..9978c225 100644 --- a/docs/product/fr/bank_account_details_v2.rst +++ b/docs/product/fr/bank_account_details_v2.rst @@ -16,3 +16,4 @@ Bank Account Details V2 .. autoclass:: mindee.product.fr.bank_account_details.bank_account_details_v2_bban.BankAccountDetailsV2Bban :members: + :inherited-members: diff --git a/docs/product/invoice_v4.rst b/docs/product/invoice_v4.rst index 8cb1916b..4b93e088 100644 --- a/docs/product/invoice_v4.rst +++ b/docs/product/invoice_v4.rst @@ -16,3 +16,4 @@ Invoice V4 .. autoclass:: mindee.product.invoice.invoice_v4_line_item.InvoiceV4LineItem :members: + :inherited-members: diff --git a/docs/product/receipt_v5.rst b/docs/product/receipt_v5.rst index 184b73fb..f48ebae7 100644 --- a/docs/product/receipt_v5.rst +++ b/docs/product/receipt_v5.rst @@ -16,3 +16,4 @@ Receipt V5 .. autoclass:: mindee.product.receipt.receipt_v5_line_item.ReceiptV5LineItem :members: + :inherited-members: diff --git a/mindee/product/barcode_reader/barcode_reader_v1.py b/mindee/product/barcode_reader/barcode_reader_v1.py index 20e63d17..a6acac81 100644 --- a/mindee/product/barcode_reader/barcode_reader_v1.py +++ b/mindee/product/barcode_reader/barcode_reader_v1.py @@ -29,4 +29,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = BarcodeReaderV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(BarcodeReaderV1Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(BarcodeReaderV1Document, page)) diff --git a/mindee/product/cropper/cropper_v1.py b/mindee/product/cropper/cropper_v1.py index 719e4216..e6822448 100644 --- a/mindee/product/cropper/cropper_v1.py +++ b/mindee/product/cropper/cropper_v1.py @@ -28,4 +28,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = CropperV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(CropperV1Page, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(CropperV1Page, page)) diff --git a/mindee/product/eu/license_plate/license_plate_v1.py b/mindee/product/eu/license_plate/license_plate_v1.py index 350d7801..585ace32 100644 --- a/mindee/product/eu/license_plate/license_plate_v1.py +++ b/mindee/product/eu/license_plate/license_plate_v1.py @@ -29,4 +29,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = LicensePlateV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(LicensePlateV1Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(LicensePlateV1Document, page)) diff --git a/mindee/product/financial_document/financial_document_v1.py b/mindee/product/financial_document/financial_document_v1.py index 11d7026c..8f457254 100644 --- a/mindee/product/financial_document/financial_document_v1.py +++ b/mindee/product/financial_document/financial_document_v1.py @@ -29,4 +29,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = FinancialDocumentV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(FinancialDocumentV1Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(FinancialDocumentV1Document, page)) diff --git a/mindee/product/fr/bank_account_details/bank_account_details_v1.py b/mindee/product/fr/bank_account_details/bank_account_details_v1.py index bb900336..1d564fc5 100644 --- a/mindee/product/fr/bank_account_details/bank_account_details_v1.py +++ b/mindee/product/fr/bank_account_details/bank_account_details_v1.py @@ -29,4 +29,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = BankAccountDetailsV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(BankAccountDetailsV1Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(BankAccountDetailsV1Document, page)) diff --git a/mindee/product/fr/bank_account_details/bank_account_details_v2.py b/mindee/product/fr/bank_account_details/bank_account_details_v2.py index d0f617d4..5ccffd47 100644 --- a/mindee/product/fr/bank_account_details/bank_account_details_v2.py +++ b/mindee/product/fr/bank_account_details/bank_account_details_v2.py @@ -29,4 +29,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = BankAccountDetailsV2Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(BankAccountDetailsV2Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(BankAccountDetailsV2Document, page)) diff --git a/mindee/product/fr/carte_grise/carte_grise_v1.py b/mindee/product/fr/carte_grise/carte_grise_v1.py index e3c28e9d..125d6dfe 100644 --- a/mindee/product/fr/carte_grise/carte_grise_v1.py +++ b/mindee/product/fr/carte_grise/carte_grise_v1.py @@ -27,4 +27,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = CarteGriseV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(CarteGriseV1Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(CarteGriseV1Document, page)) diff --git a/mindee/product/fr/carte_vitale/carte_vitale_v1.py b/mindee/product/fr/carte_vitale/carte_vitale_v1.py index 141f7022..74e56fe1 100644 --- a/mindee/product/fr/carte_vitale/carte_vitale_v1.py +++ b/mindee/product/fr/carte_vitale/carte_vitale_v1.py @@ -29,4 +29,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = CarteVitaleV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(CarteVitaleV1Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(CarteVitaleV1Document, page)) diff --git a/mindee/product/fr/id_card/id_card_v1.py b/mindee/product/fr/id_card/id_card_v1.py index 323b6b5a..1dbfcfe5 100644 --- a/mindee/product/fr/id_card/id_card_v1.py +++ b/mindee/product/fr/id_card/id_card_v1.py @@ -28,4 +28,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = IdCardV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(IdCardV1Page, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(IdCardV1Page, page)) diff --git a/mindee/product/fr/id_card/id_card_v2.py b/mindee/product/fr/id_card/id_card_v2.py index 5501b114..16343104 100644 --- a/mindee/product/fr/id_card/id_card_v2.py +++ b/mindee/product/fr/id_card/id_card_v2.py @@ -28,4 +28,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = IdCardV2Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(IdCardV2Page, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(IdCardV2Page, page)) diff --git a/mindee/product/invoice/invoice_v4.py b/mindee/product/invoice/invoice_v4.py index 7fd3b066..2efc44c6 100644 --- a/mindee/product/invoice/invoice_v4.py +++ b/mindee/product/invoice/invoice_v4.py @@ -27,4 +27,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = InvoiceV4Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(InvoiceV4Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(InvoiceV4Document, page)) diff --git a/mindee/product/invoice/invoice_v4_line_item.py b/mindee/product/invoice/invoice_v4_line_item.py index 2dcf6c78..cb3e89ed 100644 --- a/mindee/product/invoice/invoice_v4_line_item.py +++ b/mindee/product/invoice/invoice_v4_line_item.py @@ -74,7 +74,7 @@ def to_table_line(self) -> str: out_str += f"{printable['tax_amount']:<10} | " out_str += f"{printable['tax_rate']:<12} | " out_str += f"{printable['total_amount']:<12} | " - out_str += f"{printable['unit_price']:<10} |" + out_str += f"{printable['unit_price']:<10} | " return clean_out_string(out_str) def __str__(self) -> str: diff --git a/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.py b/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.py index 9238f64d..b8526df4 100644 --- a/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.py +++ b/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.py @@ -29,4 +29,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = MultiReceiptsDetectorV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(MultiReceiptsDetectorV1Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(MultiReceiptsDetectorV1Document, page)) diff --git a/mindee/product/passport/passport_v1.py b/mindee/product/passport/passport_v1.py index 118a89e0..b26abffa 100644 --- a/mindee/product/passport/passport_v1.py +++ b/mindee/product/passport/passport_v1.py @@ -27,4 +27,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = PassportV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(PassportV1Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(PassportV1Document, page)) diff --git a/mindee/product/proof_of_address/proof_of_address_v1.py b/mindee/product/proof_of_address/proof_of_address_v1.py index 22142e11..cd4a9235 100644 --- a/mindee/product/proof_of_address/proof_of_address_v1.py +++ b/mindee/product/proof_of_address/proof_of_address_v1.py @@ -29,4 +29,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = ProofOfAddressV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(ProofOfAddressV1Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(ProofOfAddressV1Document, page)) diff --git a/mindee/product/receipt/receipt_v5.py b/mindee/product/receipt/receipt_v5.py index 738fb2cd..335bbfd4 100644 --- a/mindee/product/receipt/receipt_v5.py +++ b/mindee/product/receipt/receipt_v5.py @@ -27,4 +27,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = ReceiptV5Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(ReceiptV5Document, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(ReceiptV5Document, page)) diff --git a/mindee/product/us/bank_check/bank_check_v1.py b/mindee/product/us/bank_check/bank_check_v1.py index d56f8e6c..0d146adf 100644 --- a/mindee/product/us/bank_check/bank_check_v1.py +++ b/mindee/product/us/bank_check/bank_check_v1.py @@ -28,4 +28,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = BankCheckV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(BankCheckV1Page, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(BankCheckV1Page, page)) diff --git a/mindee/product/us/driver_license/driver_license_v1.py b/mindee/product/us/driver_license/driver_license_v1.py index 76b5d6f0..1a63acdc 100644 --- a/mindee/product/us/driver_license/driver_license_v1.py +++ b/mindee/product/us/driver_license/driver_license_v1.py @@ -30,4 +30,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = DriverLicenseV1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(DriverLicenseV1Page, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(DriverLicenseV1Page, page)) diff --git a/mindee/product/us/w9/w9_v1.py b/mindee/product/us/w9/w9_v1.py index 9a872bfc..b4eea732 100644 --- a/mindee/product/us/w9/w9_v1.py +++ b/mindee/product/us/w9/w9_v1.py @@ -28,4 +28,9 @@ def __init__(self, raw_prediction: StringDict): self.prediction = W9V1Document(raw_prediction["prediction"]) self.pages = [] for page in raw_prediction["pages"]: - self.pages.append(Page(W9V1Page, page)) + try: + page_production = page["prediction"] + except KeyError: + continue + if page_production: + self.pages.append(Page(W9V1Page, page)) diff --git a/tests/data b/tests/data index ae25a730..471dfe1d 160000 --- a/tests/data +++ b/tests/data @@ -1 +1 @@ -Subproject commit ae25a730dbbe0704b03f38ec7fc3821ce5f8e756 +Subproject commit 471dfe1d2d4f3edccb503e9b0702c7769105f49d diff --git a/tests/product/barcode_reader/test_barcode_reader_v1.py b/tests/product/barcode_reader/test_barcode_reader_v1.py index 93228f7c..8ce1a49f 100644 --- a/tests/product/barcode_reader/test_barcode_reader_v1.py +++ b/tests/product/barcode_reader/test_barcode_reader_v1.py @@ -61,13 +61,3 @@ def test_empty_doc( prediction = empty_doc.inference.prediction assert len(prediction.codes_1d) == 0 assert len(prediction.codes_2d) == 0 - - -def test_complete_page_0(complete_page_0: Page[BarcodeReaderV1Document]): - reference_str = open( - PRODUCT_DATA_DIR / "barcode_reader" / "response_v1" / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str diff --git a/tests/product/eu/license_plate/test_license_plate_v1.py b/tests/product/eu/license_plate/test_license_plate_v1.py index b1181e18..3d6134cb 100644 --- a/tests/product/eu/license_plate/test_license_plate_v1.py +++ b/tests/product/eu/license_plate/test_license_plate_v1.py @@ -60,13 +60,3 @@ def test_empty_doc( ): prediction = empty_doc.inference.prediction assert len(prediction.license_plates) == 0 - - -def test_complete_page_0(complete_page_0: Page[LicensePlateV1Document]): - reference_str = open( - PRODUCT_DATA_DIR / "license_plates" / "response_v1" / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str diff --git a/tests/product/fr/bank_account_details/test_bank_account_details_v1.py b/tests/product/fr/bank_account_details/test_bank_account_details_v1.py index dcc4aa1e..04221ce4 100644 --- a/tests/product/fr/bank_account_details/test_bank_account_details_v1.py +++ b/tests/product/fr/bank_account_details/test_bank_account_details_v1.py @@ -72,13 +72,3 @@ def test_empty_doc( assert prediction.iban.value is None assert prediction.account_holder_name.value is None assert prediction.swift.value is None - - -def test_complete_page_0(complete_page_0: Page[BankAccountDetailsV1Document]): - reference_str = open( - PRODUCT_DATA_DIR / "bank_account_details" / "response_v1" / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str diff --git a/tests/product/fr/bank_account_details/test_bank_account_details_v2.py b/tests/product/fr/bank_account_details/test_bank_account_details_v2.py index 1b1895d5..b5d5dcdb 100644 --- a/tests/product/fr/bank_account_details/test_bank_account_details_v2.py +++ b/tests/product/fr/bank_account_details/test_bank_account_details_v2.py @@ -76,13 +76,3 @@ def test_empty_doc( assert prediction.bban.bban_number is None assert prediction.iban.value is None assert prediction.swift_code.value is None - - -def test_complete_page_0(complete_page_0: Page[BankAccountDetailsV2Document]): - reference_str = open( - PRODUCT_DATA_DIR / "bank_account_details" / "response_v2" / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str diff --git a/tests/product/fr/carte_grise/test_carte_grise_v1.py b/tests/product/fr/carte_grise/test_carte_grise_v1.py index 556fc7cc..a2c4f3f1 100644 --- a/tests/product/fr/carte_grise/test_carte_grise_v1.py +++ b/tests/product/fr/carte_grise/test_carte_grise_v1.py @@ -98,13 +98,3 @@ def test_empty_doc( assert prediction.owner_surname.value is None assert prediction.mrz1.value is None assert prediction.mrz2.value is None - - -def test_complete_page_0(complete_page_0: Page[CarteGriseV1Document]): - reference_str = open( - PRODUCT_DATA_DIR / "carte_grise" / "response_v1" / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str diff --git a/tests/product/fr/carte_vitale/test_carte_vitale_v1.py b/tests/product/fr/carte_vitale/test_carte_vitale_v1.py index 587ff348..1b6bce35 100644 --- a/tests/product/fr/carte_vitale/test_carte_vitale_v1.py +++ b/tests/product/fr/carte_vitale/test_carte_vitale_v1.py @@ -63,13 +63,3 @@ def test_empty_doc( assert prediction.surname.value is None assert prediction.social_security.value is None assert prediction.issuance_date.value is None - - -def test_complete_page_0(complete_page_0: Page[CarteVitaleV1Document]): - reference_str = open( - PRODUCT_DATA_DIR / "carte_vitale" / "response_v1" / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str diff --git a/tests/product/invoice/test_invoice_v4.py b/tests/product/invoice/test_invoice_v4.py index df30e884..88ad61e3 100644 --- a/tests/product/invoice/test_invoice_v4.py +++ b/tests/product/invoice/test_invoice_v4.py @@ -71,13 +71,3 @@ def test_empty_doc(empty_doc: Document[InvoiceV4Document, Page[InvoiceV4Document assert len(prediction.customer_company_registrations) == 0 assert prediction.customer_address.value is None assert len(prediction.line_items) == 0 - - -def test_complete_page_0(complete_page_0: Page[InvoiceV4Document]): - reference_str = open( - PRODUCT_DATA_DIR / "invoices" / "response_v4" / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str diff --git a/tests/product/multi_receipts_detector/test_multi_receipts_detector_v1.py b/tests/product/multi_receipts_detector/test_multi_receipts_detector_v1.py index 250a3f56..2e4c8aa0 100644 --- a/tests/product/multi_receipts_detector/test_multi_receipts_detector_v1.py +++ b/tests/product/multi_receipts_detector/test_multi_receipts_detector_v1.py @@ -79,16 +79,3 @@ def test_empty_doc( ): prediction = empty_doc.inference.prediction assert len(prediction.receipts) == 0 - - -def test_complete_page_0(complete_page_0: Page[MultiReceiptsDetectorV1Document]): - reference_str = open( - PRODUCT_DATA_DIR - / "multi_receipts_detector" - / "response_v1" - / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str diff --git a/tests/product/passport/test_passport_v1.py b/tests/product/passport/test_passport_v1.py index d7967c96..f00fb2ba 100644 --- a/tests/product/passport/test_passport_v1.py +++ b/tests/product/passport/test_passport_v1.py @@ -66,13 +66,3 @@ def test_empty_doc(empty_doc: Document[PassportV1Document, Page[PassportV1Docume assert prediction.expiry_date.value is None assert prediction.mrz1.value is None assert prediction.mrz2.value is None - - -def test_complete_page_0(complete_page_0: Page[PassportV1Document]): - reference_str = open( - PRODUCT_DATA_DIR / "passport" / "response_v1" / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str diff --git a/tests/product/proof_of_address/test_proof_of_address_v1.py b/tests/product/proof_of_address/test_proof_of_address_v1.py index ce10a0d3..83f8f708 100644 --- a/tests/product/proof_of_address/test_proof_of_address_v1.py +++ b/tests/product/proof_of_address/test_proof_of_address_v1.py @@ -72,13 +72,3 @@ def test_empty_doc( assert prediction.recipient_address.value is None assert len(prediction.dates) == 0 assert prediction.date.value is None - - -def test_complete_page_0(complete_page_0: Page[ProofOfAddressV1Document]): - reference_str = open( - PRODUCT_DATA_DIR / "proof_of_address" / "response_v1" / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str diff --git a/tests/product/receipt/test_receipt_v5.py b/tests/product/receipt/test_receipt_v5.py index e51c3a56..7cfbd0d4 100644 --- a/tests/product/receipt/test_receipt_v5.py +++ b/tests/product/receipt/test_receipt_v5.py @@ -68,13 +68,3 @@ def test_empty_doc(empty_doc: Document[ReceiptV5Document, Page[ReceiptV5Document assert prediction.supplier_address.value is None assert prediction.supplier_phone_number.value is None assert len(prediction.line_items) == 0 - - -def test_complete_page_0(complete_page_0: Page[ReceiptV5Document]): - reference_str = open( - PRODUCT_DATA_DIR / "expense_receipts" / "response_v5" / "summary_page0.rst", - "r", - encoding="utf-8", - ).read() - assert complete_page_0.id == 0 - assert str(complete_page_0) == reference_str