Skip to content

bank_accounts

Pre-configured chart of accounts for a commercial bank.

All bank-specific accounts are created as plain TAccount or CompositeTAccount instances — no subclasses needed. The :class:BankChartOfAccounts uses :class:ChartOfAccountsBuilder to construct and validate the chart.

Classes:

BankChartOfAccounts

BankChartOfAccounts()

Bases: ChartOfAccounts

Pre-configured chart of accounts for a commercial bank.

Every account is accessible as a named attribute. Composite accounts automatically aggregate their sub-accounts. Contra accounts reduce the balance of the account they are attached to.

Account hierarchy::

Assets
├── Cash and Cash Equivalents
├── Receivables from Financial Institutions
├── Loans and Advances
│   └── Loan Loss Provision                ← contra
├── Assets at FVTPL (Trading Book)
├── Investment Securities                  ← composite
│   ├── Investment Securities at Amortized Cost (HTM)
│   └── Investment Securities at FVOCI
├── Property, Plant and Equipment
└── Intangible Assets

Liabilities
├── Deposits and Other Public Borrowings   ← composite
│   ├── Deposits (Customer)
│   └── Other Public Borrowings
├── Payables to Financial Institutions
└── Debt Issues

Equity
├── Shareholders' Equity
└── Accumulated OCI                        ← composite
    ├── Unrealized OCI Gain
    └── Unrealized OCI Loss                ← contra

Income
├── Interest Income                        ← composite
├── Trading Income (FVTPL)                 ← composite
│   ├── Unrealized Trading Gain
│   ├── Realized Trading Gain
│   ├── Unrealized Trading Loss
│   └── Realized Trading Loss
└── Investment Income (FVOCI)              ← composite
    ├── Realized OCI Gain
    └── Realized OCI Loss

Expenses
├── Interest Expense
└── Operating Expense

Methods:

  • all_accounts

    Yield every account including nested sub-accounts (depth-first).

all_accounts

all_accounts() -> Generator[TAccount, None, None]

Yield every account including nested sub-accounts (depth-first).

Unlike __iter__, this expands composite accounts so that both the composite and all of its descendants are yielded. Useful for lookups by name when the target may be a sub-account.