Financial Document V1
Sample Code:
#
# Install the Python client library by running:
# pip install mindee
#
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.FinancialDocumentV1,
input_doc,
)
# Print a brief summary of the parsed data
print(result.document)
- class FinancialDocumentV1(raw_prediction)
Financial Document API version 1 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: Optional[str] = 'financial_document'
Name of the endpoint.
- endpoint_version: Optional[str] = '1'
Version of the endpoint.
- extras: Optional[Extras] = None
Potential Extras fields sent back along with the prediction.
- 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[FinancialDocumentV1Document]] Page-level prediction(s).
-
prediction:
FinancialDocumentV1Document Document-level prediction.
- product: Product
Name and version of a given product, as sent back by the API.
- class FinancialDocumentV1Document(raw_prediction, page_id=None)
Financial Document API version 1.14 document data.
- Parameters:
raw_prediction (Dict[str, Any])
page_id (int | None)
-
billing_address:
AddressField The customer’s address used for billing.
-
category:
ClassificationField The purchase category.
-
customer_address:
AddressField The address of the customer.
-
customer_company_registrations:
List[CompanyRegistrationField] List of company registration numbers associated to the customer.
-
customer_id:
StringField The customer account number or identifier from the supplier.
-
customer_name:
StringField The name of the customer.
-
document_number:
StringField The document number or identifier (invoice number or receipt number).
-
document_type:
ClassificationField The type of the document: INVOICE or CREDIT NOTE if it is an invoice, CREDIT CARD RECEIPT or EXPENSE RECEIPT if it is a receipt.
-
document_type_extended:
ClassificationField Document type extended.
-
invoice_number:
StringField The invoice number or identifier only if document is an invoice.
-
line_items:
List[FinancialDocumentV1LineItem] List of line item present on the document.
-
locale:
LocaleField The locale of the document.
-
po_number:
StringField The purchase order number, only if the document is an invoice.
-
receipt_number:
StringField The receipt number or identifier only if document is a receipt.
-
reference_numbers:
List[StringField] List of Reference numbers, including PO number, only if the document is an invoice.
-
shipping_address:
AddressField The customer’s address used for shipping.
-
subcategory:
ClassificationField The purchase subcategory for transport, food and shooping.
-
supplier_address:
AddressField The address of the supplier or merchant.
-
supplier_company_registrations:
List[CompanyRegistrationField] List of company registration numbers associated to the supplier.
-
supplier_email:
StringField The email of the supplier or merchant.
-
supplier_name:
StringField The name of the supplier or merchant.
-
supplier_payment_details:
List[PaymentDetailsField] List of payment details associated to the supplier (only for invoices).
-
supplier_phone_number:
StringField The phone number of the supplier or merchant.
-
supplier_website:
StringField The website URL of the supplier or merchant.
-
time:
StringField The time the purchase was made (only for receipts).
-
tip:
AmountField The total amount of tip and gratuity
-
total_amount:
AmountField The total amount paid: includes taxes, tips, fees, and other charges.
-
total_net:
AmountField The net amount paid: does not include taxes, fees, and discounts.
-
total_tax:
AmountField The sum of all taxes present on the document.
- class FinancialDocumentV1LineItem(raw_prediction, page_id=None)
List of line item present on the document.
- Parameters:
raw_prediction (Dict[str, Any])
page_id (int | None)
- to_table_line()
Output in a format suitable for inclusion in an rST table.
- Return type:
str
- bounding_box: Optional[Quadrilateral]
A right rectangle containing the word in the document.
- confidence: float
The confidence score.
-
description:
Optional[str] The item description.
-
page_n:
int The document page on which the information was found.
- polygon: Polygon
A polygon containing the word in the document.
-
product_code:
Optional[str] The product code referring to the item.
-
quantity:
Optional[float] The item quantity
-
tax_amount:
Optional[float] The item tax amount.
-
tax_rate:
Optional[float] The item tax rate in percentage.
-
total_amount:
Optional[float] The item total amount.
-
unit_measure:
Optional[str] The item unit of measure.
-
unit_price:
Optional[float] The item unit price.