app.parsers.schemas moduleΒΆ
- class app.parsers.schemas.ColumnMapping(date: int | None = None, value_date: int | None = None, description: int | None = None, reference: int | None = None, amount: int | None = None, debit: int | None = None, credit: int | None = None, balance: int | None = None, currency: int | None = None, transaction_type: int | None = None)[source]ΒΆ
Bases:
objectMaps logical field names to actual CSV column indices.
- amount: int | None = NoneΒΆ
- balance: int | None = NoneΒΆ
- credit: int | None = NoneΒΆ
- currency: int | None = NoneΒΆ
- date: int | None = NoneΒΆ
- debit: int | None = NoneΒΆ
- description: int | None = NoneΒΆ
- reference: int | None = NoneΒΆ
- transaction_type: int | None = NoneΒΆ
- value_date: int | None = NoneΒΆ
- class app.parsers.schemas.ParsedBankStatement(bank_name: str | None, account_number: str | None, account_holder: str | None, currency: str | None, statement_from: ~datetime.date | None, statement_to: ~datetime.date | None, opening_balance: ~decimal.Decimal | None, closing_balance: ~decimal.Decimal | None, transactions: list[~app.parsers.schemas.ParsedTransaction], detected_encoding: str, detected_delimiter: str, detected_format: str, raw_headers: dict, column_mapping: ~app.parsers.schemas.ColumnMapping, total_rows_parsed: int, total_rows_skipped: int, parser_version: str = 'csv-parser-v1.0.0', warnings: list[dict] = <factory>)[source]ΒΆ
Bases:
objectFinal result from the full CSV parsing pipeline.
- account_holder: str | NoneΒΆ
- account_number: str | NoneΒΆ
- bank_name: str | NoneΒΆ
- closing_balance: Decimal | NoneΒΆ
- column_mapping: ColumnMappingΒΆ
- currency: str | NoneΒΆ
- detected_delimiter: strΒΆ
- detected_encoding: strΒΆ
- detected_format: strΒΆ
- opening_balance: Decimal | NoneΒΆ
- parser_version: str = 'csv-parser-v1.0.0'ΒΆ
- raw_headers: dictΒΆ
- statement_from: date | NoneΒΆ
- statement_to: date | NoneΒΆ
- total_rows_parsed: intΒΆ
- total_rows_skipped: intΒΆ
- transactions: list[ParsedTransaction]ΒΆ
- warnings: list[dict]ΒΆ
- class app.parsers.schemas.ParsedInvoice(invoice_number: str | None = None, invoice_date: datetime.date | None = None, due_date: datetime.date | None = None, currency: str | None = None, subtotal: decimal.Decimal | None = None, tax_amount: decimal.Decimal | None = None, discount_amount: decimal.Decimal | None = None, total_amount: decimal.Decimal | None = None, raw_vendor_name: str | None = None, raw_date_text: str | None = None, raw_total_text: str | None = None, confidence: decimal.Decimal = Decimal('1.000'), notes: str | None = None, line_items: list[app.parsers.schemas.ParsedInvoiceLineItem] = <factory>, warnings: list[str] = <factory>, parser_version: str = 'pdf-parser-v1.0.0')[source]ΒΆ
Bases:
object- confidence: Decimal = Decimal('1.000')ΒΆ
- currency: str | None = NoneΒΆ
- discount_amount: Decimal | None = NoneΒΆ
- due_date: date | None = NoneΒΆ
- invoice_date: date | None = NoneΒΆ
- invoice_number: str | None = NoneΒΆ
- line_items: list[ParsedInvoiceLineItem]ΒΆ
- notes: str | None = NoneΒΆ
- parser_version: str = 'pdf-parser-v1.0.0'ΒΆ
- raw_date_text: str | None = NoneΒΆ
- raw_total_text: str | None = NoneΒΆ
- raw_vendor_name: str | None = NoneΒΆ
- subtotal: Decimal | None = NoneΒΆ
- tax_amount: Decimal | None = NoneΒΆ
- total_amount: Decimal | None = NoneΒΆ
- warnings: list[str]ΒΆ
- class app.parsers.schemas.ParsedInvoiceLineItem(line_number: int, description: str | None = None, quantity: decimal.Decimal | None = None, unit_price: decimal.Decimal | None = None, line_total: decimal.Decimal | None = None, tax_rate: decimal.Decimal | None = None, tax_amount: decimal.Decimal | None = None, sku: str | None = None, unit_of_measure: str | None = None)[source]ΒΆ
Bases:
object- description: str | None = NoneΒΆ
- line_number: intΒΆ
- line_total: Decimal | None = NoneΒΆ
- quantity: Decimal | None = NoneΒΆ
- sku: str | None = NoneΒΆ
- tax_amount: Decimal | None = NoneΒΆ
- tax_rate: Decimal | None = NoneΒΆ
- unit_of_measure: str | None = NoneΒΆ
- unit_price: Decimal | None = NoneΒΆ
- class app.parsers.schemas.ParsedTransaction(row_index: int, transaction_date: date, value_date: date | None, description: str | None, raw_description: str | None, reference_number: str | None, transaction_type: TransactionType, amount: Decimal, direction: str, balance_after: Decimal | None, currency: str | None, parse_warnings: list[str] = <factory>)[source]ΒΆ
Bases:
objectOne fully-parsed transaction row.
- amount: DecimalΒΆ
- balance_after: Decimal | NoneΒΆ
- currency: str | NoneΒΆ
- description: str | NoneΒΆ
- direction: strΒΆ
- parse_warnings: list[str]ΒΆ
- raw_description: str | NoneΒΆ
- reference_number: str | NoneΒΆ
- row_index: intΒΆ
- transaction_date: dateΒΆ
- transaction_type: TransactionTypeΒΆ
- value_date: date | NoneΒΆ