piecash.core.account module¶
-
class
piecash.core.account.
Account
(name, type, commodity, parent=None, description='', commodity_scu=None, hidden=0, placeholder=0, code='', book=None, children=None)[source]¶ Bases:
piecash._declbase.DeclarativeBaseGuid
A GnuCash Account which is specified by its name, type and commodity.
-
commodity
¶ the commodity of the account
1 if the account is hidden
- Type
-
splits
¶ the list of the splits linked to the account
- Type
list of
piecash.core.transaction.Split
-
lots
¶ the list of lots to which the account is linked
- Type
list of
piecash.business.Lot
-
book
¶ the book if the account is the root account (else None)
-
budget_amounts
¶ list of budget amounts of the account
- Type
list of
piecash.budget.BudgetAmount
-
scheduled_transaction
¶ scheduled transaction linked to the account
-
object_to_validate
(change)[source]¶ yield the objects to validate when the object is modified (change=”new” “deleted” or “dirty”).
For instance, if the object is a Split, if it changes, we want to revalidate not the split but its transaction and its lot (if any). split.object_to_validate should yeild both split.transaction and split.lot
-
get_balance
(recurse=True, commodity=None, natural_sign=True, at_date=None)[source]¶ Returns the balance of the account (including its children accounts if recurse=True) expressed in account’s commodity/currency. If this is a stock/fund account, it will return the number of shares held. If this is a currency account, it will be in account’s currency. In case of recursion, the commodity of children accounts will be transformed to the commodity of the father account using the latest price (if no price is available to convert , it is considered as 0). If natural_sign is True, the sign of the balance is reverted for the account with type {‘LIABILITY’, ‘PAYABLE’, ‘CREDIT’, ‘INCOME’, ‘EQUITY’}
-
commodity
¶ the currency into which to get the balance (default to None, i.e. the currency of the account)
-
natural_sign
¶ True if the balance sign is reversed for accounts of type {‘LIABILITY’, ‘PAYABLE’, ‘CREDIT’, ‘INCOME’, ‘EQUITY’} (default to True)
- Type
bool, optional
-
at_date
¶ the sum() balance of the account at a given date based on transaction post date
- Type
- Returns
the balance of the account
-
-