Financial Document V1
Sample Code:
#
# Install the Python client library by running:
# pip install mindee
#
from mindee.v1 import Client, product, AsyncPredictResponse
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 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: str | None = 'financial_document'
Name of the endpoint.
- endpoint_version: str | None = '1'
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[FinancialDocumentV1Document]]
Page-level prediction(s).
- prediction: FinancialDocumentV1Document
Document-level prediction.
- 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: Quadrilateral | None
A right rectangle containing the word in the document.
- confidence: float
The confidence score.
- description: str | None
The item description.
- page_n: int
The document page on which the information was found.
- product_code: str | None
The product code referring to the item.
- quantity: float | None
The item quantity
- tax_amount: float | None
The item tax amount.
- tax_rate: float | None
The item tax rate in percentage.
- total_amount: float | None
The item total amount.
- unit_measure: str | None
The item unit of measure.
- unit_price: float | None
The item unit price.