account
Module for various types of accounts used in a bank's chart of accounts.
Classes:
-
AccountBalances
–A dictionary-like class to hold account balances.
-
AccountNormalBalance
–The normal balance of an account or the preferred type of net balance that it should have.
-
AccountType
–Types of accounts.
-
AccumulatedOCIAccount
–Accumulated OCI account.
-
AssetFVTPLAccount
–Asset FVTPL account, or Financial Assets - Trading (FVTPL).
-
BankChartOfAccounts
–Represent the chart of accounts.
-
CashAccount
–Cash account.
-
ChartOfAccounts
–Represent the chart of accounts.
-
ChartOfAccountsBuilder
–Builder for creating a ChartOfAccounts instance.
-
CompositeTAccount
–Composite T-account that can hold multiple sub T-accounts.
-
CustomerDepositAccount
–Customer deposit account.
-
DebtAccount
–Debt account.
-
DepositAccount
–Deposit account.
-
EquityAccount
–Equity account.
-
IncomeSummaryAccount
–Represent the income summary account.
-
IntangibleAccount
–Intangible account.
-
InterestExpenseAccount
–Interest expense account.
-
InterestIncomeAccount
–Interest income account.
-
InvestmentFVOCIAccount
–Investment FVOCI account.
-
InvestmentHTMAccount
–Investment HTM account, or Investment Securities at Amortized Cost.
-
InvestmentIncomeAccount
–Investment income account.
-
InvestmentSecuritiesAccount
–Investment securities account.
-
LoanAccount
–Loan account.
-
OperatingExpenseAccount
–Operating expense account.
-
PPEAccount
–PPE account.
-
PayableAccount
–Payable account.
-
PublicBorrowingsAccount
–Public borrowings account.
-
RealizedOCIGainAccount
–Realized OCI Gain account.
-
RealizedOCILossAccount
–Realized OCI Loss account.
-
RealizedTradingGainAccount
–Realized Trading Gain account.
-
RealizedTradingLossAccount
–Realized Trading Loss account.
-
RealizedTradingPnLAccount
–Realized Trading P&L account.
-
ReceivableAccount
–Receivable account.
-
RetainedEarningsAccount
–Represent the retained earnings account.
-
TAccount
–Base class representing a T-account, which holds amounts on both the debit and credit sides.
-
TradingIncomeAccount
–Trading income account.
-
UnrealizedOCIGainAccount
–Unrealized OCI Gain account.
-
UnrealizedOCILossAccount
–Unrealized OCI Loss account.
-
UnrealizedTradingGainAccount
–Unrealized Trading Gain account.
-
UnrealizedTradingLossAccount
–Unrealized Trading Loss account.
-
UnrealizedTradingPnLAccount
–Unrealized Trading P&L account.
AccountBalances
Bases: UserDict['TAccount', float]
A dictionary-like class to hold account balances.
Methods:
-
from_accounts
–Create an AccountBalances instance from a list of accounts.
from_accounts
classmethod
from_accounts(accounts: list[TAccount]) -> AccountBalances
Create an AccountBalances instance from a list of accounts.
AccountNormalBalance
Bases: Enum
The normal balance of an account or the preferred type of net balance that it should have.
AccountType
Bases: Enum
Types of accounts.
Methods:
-
get_normal_balance
–Return the normal balance for a given account type.
get_normal_balance
staticmethod
get_normal_balance(
account_type: AccountType,
*,
contra_account: bool = False,
) -> AccountNormalBalance
Return the normal balance for a given account type.
AccumulatedOCIAccount
AccumulatedOCIAccount()
Bases: CompositeTAccount
Accumulated OCI account.
Methods:
-
add
–Add a T-account as a child and observe it.
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove
–Remove a T-account as a child and stop observing it.
-
remove_observer
–Remove an observer from the list of observers.
-
update
–Triggered when a child account notifies of a change.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
AssetFVTPLAccount
AssetFVTPLAccount()
Bases: TAccount
Asset FVTPL account, or Financial Assets - Trading (FVTPL).
Assets at Fair Value Through Income Statement (FVTPL) - Trading Book securities
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
BankChartOfAccounts
dataclass
BankChartOfAccounts(
assets: list[TAccount] = list(),
equities: list[TAccount] = list(),
liabilities: list[TAccount] = list(),
income: list[TAccount] = list(),
expenses: list[TAccount] = list(),
income_summary_account: IncomeSummaryAccount = IncomeSummaryAccount(),
retained_earnings_account: RetainedEarningsAccount = RetainedEarningsAccount(),
cash_account: CashAccount = CashAccount(),
receivable_account: ReceivableAccount = ReceivableAccount(),
loan_account: LoanAccount = LoanAccount(),
asset_fvtpl_account: AssetFVTPLAccount = AssetFVTPLAccount(),
investment_securities_account: InvestmentSecuritiesAccount = InvestmentSecuritiesAccount(),
ppe_account: PPEAccount = PPEAccount(),
intangible_account: IntangibleAccount = IntangibleAccount(),
deposit_account: DepositAccount = DepositAccount(),
payable_account: PayableAccount = PayableAccount(),
debt_account: DebtAccount = DebtAccount(),
equity_account: EquityAccount = EquityAccount(),
accumulated_oci_account: AccumulatedOCIAccount = AccumulatedOCIAccount(),
interest_income_account: InterestIncomeAccount = InterestIncomeAccount(),
trading_income_account: TradingIncomeAccount = TradingIncomeAccount(),
investment_income_account: InvestmentIncomeAccount = InvestmentIncomeAccount(),
interest_expense_account: InterestExpenseAccount = InterestExpenseAccount(),
operating_expense_account: OperatingExpenseAccount = OperatingExpenseAccount(),
)
CashAccount
CashAccount()
Bases: TAccount
Cash account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
ChartOfAccounts
dataclass
ChartOfAccounts(
assets: list[TAccount] = list(),
equities: list[TAccount] = list(),
liabilities: list[TAccount] = list(),
income: list[TAccount] = list(),
expenses: list[TAccount] = list(),
income_summary_account: IncomeSummaryAccount = IncomeSummaryAccount(),
retained_earnings_account: RetainedEarningsAccount = RetainedEarningsAccount(),
)
Represent the chart of accounts.
ChartOfAccountsBuilder
ChartOfAccountsBuilder()
Builder for creating a ChartOfAccounts instance.
Methods:
-
add_asset_account
–Add an asset account to the builder.
-
add_equity_account
–Add an equity account to the builder.
-
add_expense_account
–Add an expense account to the builder.
-
add_income_account
–Add an income account to the builder.
-
add_liability_account
–Add a liability account to the builder.
-
build
–Build and return a ChartOfAccounts instance.
add_asset_account
add_asset_account(
account: TAccount,
) -> ChartOfAccountsBuilder
Add an asset account to the builder.
add_equity_account
add_equity_account(
account: TAccount,
) -> ChartOfAccountsBuilder
Add an equity account to the builder.
add_expense_account
add_expense_account(
account: TAccount,
) -> ChartOfAccountsBuilder
Add an expense account to the builder.
add_income_account
add_income_account(
account: TAccount,
) -> ChartOfAccountsBuilder
Add an income account to the builder.
add_liability_account
add_liability_account(
account: TAccount,
) -> ChartOfAccountsBuilder
Add a liability account to the builder.
CompositeTAccount
CompositeTAccount(
name: str,
account_type: AccountType,
contra_accounts: list[TAccount] | None = None,
parent: Optional[TAccount] = None,
debit: float = 0.0,
credit: float = 0.0,
*,
is_contra_account: bool = False,
)
Bases: TAccount
, Observable
, Observer
Composite T-account that can hold multiple sub T-accounts.
Methods:
-
add
–Add a T-account as a child and observe it.
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove
–Remove a T-account as a child and stop observing it.
-
remove_observer
–Remove an observer from the list of observers.
-
update
–Triggered when a child account notifies of a change.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
CustomerDepositAccount
CustomerDepositAccount()
Bases: TAccount
Customer deposit account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
DebtAccount
DebtAccount()
Bases: TAccount
Debt account.
Debt issues (typically long-term)
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
DepositAccount
DepositAccount()
Bases: CompositeTAccount
Deposit account.
Methods:
-
add
–Add a T-account as a child and observe it.
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove
–Remove a T-account as a child and stop observing it.
-
remove_observer
–Remove an observer from the list of observers.
-
update
–Triggered when a child account notifies of a change.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
EquityAccount
EquityAccount()
Bases: TAccount
Equity account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
IncomeSummaryAccount
IncomeSummaryAccount()
Bases: TAccount
Represent the income summary account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
IntangibleAccount
IntangibleAccount()
Bases: TAccount
Intangible account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
InterestExpenseAccount
InterestExpenseAccount()
Bases: TAccount
Interest expense account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
InterestIncomeAccount
InterestIncomeAccount()
Bases: CompositeTAccount
Interest income account.
Methods:
-
add
–Add a T-account as a child and observe it.
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove
–Remove a T-account as a child and stop observing it.
-
remove_observer
–Remove an observer from the list of observers.
-
update
–Triggered when a child account notifies of a change.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
InvestmentFVOCIAccount
InvestmentFVOCIAccount()
Bases: TAccount
Investment FVOCI account.
Investment Securities at Fair Value Through Other Comprehensive Income (FVOCI) - Banking Book: Some debt securities where the bank intends to collect cash flows and sell occasionally. - Changes in fair value are recorded in OCI, not P&L, until sale.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
InvestmentHTMAccount
InvestmentHTMAccount()
Bases: TAccount
Investment HTM account, or Investment Securities at Amortized Cost.
Investment Securities at Amortized Cost (HTM - Held to Maturity) This account includes debt securities (bonds, treasuries) that the bank intends to hold until maturity. - Banking Book only - No fair value adjustments unless impaired.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
InvestmentIncomeAccount
InvestmentIncomeAccount()
Bases: CompositeTAccount
Investment income account.
Methods:
-
add
–Add a T-account as a child and observe it.
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove
–Remove a T-account as a child and stop observing it.
-
remove_observer
–Remove an observer from the list of observers.
-
update
–Triggered when a child account notifies of a change.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
InvestmentSecuritiesAccount
InvestmentSecuritiesAccount()
Bases: CompositeTAccount
Investment securities account.
Methods:
-
add
–Add a T-account as a child and observe it.
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove
–Remove a T-account as a child and stop observing it.
-
remove_observer
–Remove an observer from the list of observers.
-
update
–Triggered when a child account notifies of a change.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
LoanAccount
LoanAccount()
Bases: TAccount
Loan account.
Loans provided to customers that the bank intends to hold until maturity and collect principal and interest. - Banking Book only
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
OperatingExpenseAccount
OperatingExpenseAccount()
Bases: TAccount
Operating expense account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
PPEAccount
PPEAccount()
Bases: TAccount
PPE account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
PayableAccount
PayableAccount()
Bases: TAccount
Payable account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
PublicBorrowingsAccount
PublicBorrowingsAccount()
Bases: TAccount
Public borrowings account.
Other public borrowings (typically short-term)
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
RealizedOCIGainAccount
RealizedOCIGainAccount()
Bases: TAccount
Realized OCI Gain account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
RealizedOCILossAccount
RealizedOCILossAccount()
Bases: TAccount
Realized OCI Loss account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
RealizedTradingGainAccount
RealizedTradingGainAccount()
Bases: TAccount
Realized Trading Gain account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
RealizedTradingLossAccount
RealizedTradingLossAccount()
Bases: TAccount
Realized Trading Loss account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
RealizedTradingPnLAccount
RealizedTradingPnLAccount()
Bases: TAccount
Realized Trading P&L account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
ReceivableAccount
ReceivableAccount()
Bases: TAccount
Receivable account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
RetainedEarningsAccount
RetainedEarningsAccount()
Bases: TAccount
Represent the retained earnings account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
TAccount
TAccount(
name: str,
account_type: AccountType,
contra_accounts: list[TAccount] | None = None,
parent: Optional[TAccount] = None,
debit: float = 0.0,
credit: float = 0.0,
description: str = "",
*,
is_contra_account: bool = False,
is_temporary_account: bool = False,
)
Bases: Observable
Base class representing a T-account, which holds amounts on both the debit and credit sides.
Simple T-account with no sub-accounts.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
TradingIncomeAccount
TradingIncomeAccount()
Bases: CompositeTAccount
Trading income account.
Methods:
-
add
–Add a T-account as a child and observe it.
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove
–Remove a T-account as a child and stop observing it.
-
remove_observer
–Remove an observer from the list of observers.
-
update
–Triggered when a child account notifies of a change.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
UnrealizedOCIGainAccount
UnrealizedOCIGainAccount(contra_accounts: list[TAccount])
Bases: TAccount
Unrealized OCI Gain account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
UnrealizedOCILossAccount
UnrealizedOCILossAccount()
Bases: TAccount
Unrealized OCI Loss account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
UnrealizedTradingGainAccount
UnrealizedTradingGainAccount()
Bases: TAccount
Unrealized Trading Gain account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
UnrealizedTradingLossAccount
UnrealizedTradingLossAccount()
Bases: TAccount
Unrealized Trading Loss account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.
UnrealizedTradingPnLAccount
UnrealizedTradingPnLAccount()
Bases: TAccount
Unrealized Trading P&L account.
Methods:
-
add_observer
–Add an observer to the list of observers.
-
balance
–Return account balance.
-
credit
–Add credit amount to account.
-
debit
–Add debit amount to account.
-
has_contra_account
–Check if the T-account has any contra account.
-
has_sub_account
–Check if the T-account has any sub account.
-
is_balanced
–Check if the T-account is balanced.
-
is_composite
–Check if the T-account is composite.
-
notify_observers
–Notify all observers about a change.
-
remove_observer
–Remove an observer from the list of observers.
Attributes:
-
credit_value
(float
) –Return the credit value of the account.
-
debit_value
(float
) –Return the debit value of the account.
-
parent
(Optional[TAccount]
) –Get the parent account.
-
sub_accounts
(Generator[TAccount, None, None]
) –Return an iterator over sub-accounts.
credit_value
property
writable
credit_value: float
Return the credit value of the account.
debit_value
property
writable
debit_value: float
Return the debit value of the account.
sub_accounts
property
sub_accounts: Generator[TAccount, None, None]
Return an iterator over sub-accounts.
balance
balance() -> float
Return account balance.
credit
credit(amount: float) -> None
Add credit amount to account.
debit
debit(amount: float) -> None
Add debit amount to account.
has_contra_account
has_contra_account() -> bool
Check if the T-account has any contra account.
has_sub_account
has_sub_account() -> bool
Check if the T-account has any sub account.
is_balanced
is_balanced() -> bool
Check if the T-account is balanced.
is_composite
is_composite() -> bool
Check if the T-account is composite.
notify_observers
notify_observers() -> None
Notify all observers about a change.
remove_observer
remove_observer(observer: Observer) -> None
Remove an observer from the list of observers.