GnuCash c935c2f+
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
gnucash_core.py File Reference

High level python wrapper classes for the core parts of GnuCash. More...

Go to the source code of this file.

Data Structures

class  python.gnucash_core.GnuCashCoreClass
 
class  python.gnucash_core.GnuCashBackendException
 
class  python.gnucash_core.SessionOpenMode
 
class  python.gnucash_core.Session
 
class  python.gnucash_core.Book
 
class  python.gnucash_core.GncNumeric
 
class  python.gnucash_core.GncPrice
 
class  python.gnucash_core.GncPriceDB
 
class  python.gnucash_core.GncCommodity
 
class  python.gnucash_core.GncCommodityTable
 
class  python.gnucash_core.GncCommodityNamespace
 
class  python.gnucash_core.GncLot
 
class  python.gnucash_core.Transaction
 
class  python.gnucash_core.Split
 
class  python.gnucash_core.Account
 
class  python.gnucash_core.GUID
 
class  python.gnucash_core.GUIDString
 
class  python.gnucash_core.Query
 
class  python.gnucash_core.QueryStringPredicate
 
class  python.gnucash_core.QueryBooleanPredicate
 
class  python.gnucash_core.QueryInt32Predicate
 
class  python.gnucash_core.QueryDatePredicate
 
class  python.gnucash_core.QueryGuidPredicate
 
class  python.gnucash_core.QueryNumericPredicate
 

Functions

 python.gnucash_core._ (s)
 
 python.gnucash_core.gnc_pricedb_lookup_latest_before_t64 (self, commodity, currency, date)
 
 python.gnucash_core.decorate_monetary_list_returning_function (orig_function)
 
 python.gnucash_core.one_arg_default_none (function)
 

Variables

 python.gnucash_core._localedir = _sw_core_utils.gnc_path_get_localedir()
 
 python.gnucash_core.exc_type
 
 python.gnucash_core.exc_value
 
 python.gnucash_core.exc_traceback
 
 python.gnucash_core.lookup_latest_before_t64
 
dict python.gnucash_core.PriceDB_dict
 
 python.gnucash_core.None
 
 python.gnucash_core.mode
 
 python.gnucash_core.get_book
 
 python.gnucash_core.book
 
 python.gnucash_core.this_module_dict = globals()
 
dict python.gnucash_core.backend_error_dict = {}
 
 python.gnucash_core.get_root_account
 
 python.gnucash_core.get_table
 
 python.gnucash_core.get_price_db
 
dict python.gnucash_core.gncnumeric_dict
 
dict python.gnucash_core.gnc_commodity_dict
 
dict python.gnucash_core.gnc_price_dict
 
dict python.gnucash_core.commoditytable_dict
 
 python.gnucash_core.get_commodity_list
 
dict python.gnucash_core.gnclot_dict
 
dict python.gnucash_core.trans_dict
 
dict python.gnucash_core.split_dict
 
 python.gnucash_core.account
 
 python.gnucash_core.parent
 
dict python.gnucash_core.account_dict
 
 python.gnucash_core.name
 
dict python.gnucash_core.guid_dict
 define addition methods for GUID object - do we need these
 

Detailed Description

High level python wrapper classes for the core parts of GnuCash.

Author
Mark Jenkins, ParIT Worker Co-operative mark@.nosp@m.pari.nosp@m.t.ca
Jeff Green, ParIT Worker Co-operative jeff@.nosp@m.pari.nosp@m.t.ca

Definition in file gnucash_core.py.

Function Documentation

◆ _()

python.gnucash_core._ (   s)
protected
Null translator function, gettext not available

Definition at line 205 of file gnucash_core.py.

205 def _(s):
206 """Null translator function, gettext not available"""
207 return s
208

◆ decorate_monetary_list_returning_function()

python.gnucash_core.decorate_monetary_list_returning_function (   orig_function)

Definition at line 843 of file gnucash_core.py.

843def decorate_monetary_list_returning_function(orig_function):
844 def new_function(self, *args):
845 """decorate function that returns list of gnc_monetary to return tuples of GncCommodity and GncNumeric
846
847 Args:
848 *args: Variable length argument list. Will get passed to orig_function
849
850 Returns:
851 array of tuples: (GncCommodity, GncNumeric)
852
853 ToDo:
854 Maybe this function should better reside in module function_class (?)"""
855 # warning, item.commodity has been shown to be None
856 # when the transaction doesn't have a currency
857 return [(GncCommodity(instance=item.commodity),
858 GncNumeric(instance=item.value))
859 for item in orig_function(self, *args) ]
860 return new_function
861
The primary numeric class for representing amounts and values.

◆ gnc_pricedb_lookup_latest_before_t64()

python.gnucash_core.gnc_pricedb_lookup_latest_before_t64 (   self,
  commodity,
  currency,
  date 
)

Definition at line 762 of file gnucash_core.py.

762def gnc_pricedb_lookup_latest_before_t64(self, commodity, currency, date):
763 return self.lookup_nearest_before_t64(commodity, currency, date)
764

◆ one_arg_default_none()

python.gnucash_core.one_arg_default_none (   function)

Definition at line 900 of file gnucash_core.py.

900def one_arg_default_none(function):
901 return default_arguments_decorator(function, None, None)

Variable Documentation

◆ _localedir

python.gnucash_core._localedir = _sw_core_utils.gnc_path_get_localedir()
protected

Definition at line 194 of file gnucash_core.py.

◆ account

python.gnucash_core.account

Definition at line 1104 of file gnucash_core.py.

◆ account_dict

dict python.gnucash_core.account_dict
Initial value:
1= {
2 'get_book' : Book,
3 'Lookup' : Account,
4 'get_parent' : Account,
5 'get_root' : Account,
6 'nth_child' : Account,
7 'lookup_by_code' : Account,
8 'lookup_by_name' : Account,
9 'lookup_by_full_name' : Account,
10 'FindTransByDesc' : Transaction,
11 'FindSplitByDesc' : Split,
12 'GetBalance' : GncNumeric,
13 'GetClearedBalance' : GncNumeric,
14 'GetReconciledBalance' : GncNumeric,
15 'GetPresentBalance' : GncNumeric,
16 'GetProjectedMinimumBalance' : GncNumeric,
17 'GetBalanceAsOfDate' : GncNumeric,
18 'ConvertBalanceToCurrency' : GncNumeric,
19 'ConvertBalanceToCurrencyAsOfDate' : GncNumeric,
20 'GetBalanceInCurrency' : GncNumeric,
21 'GetClearedBalanceInCurrency' : GncNumeric,
22 'GetReconciledBalanceInCurrency' : GncNumeric,
23 'GetPresentBalanceInCurrency' : GncNumeric,
24 'GetProjectedMinimumBalanceInCurrency' : GncNumeric,
25 'GetBalanceAsOfDateInCurrency' : GncNumeric,
26 'GetBalanceChangeForPeriod' : GncNumeric,
27 'GetCommodity' : GncCommodity,
28 'get_currency_or_parent' : GncCommodity,
29 'GetGUID': GUID
30 }

Definition at line 1113 of file gnucash_core.py.

◆ backend_error_dict

dict python.gnucash_core.backend_error_dict = {}

Definition at line 921 of file gnucash_core.py.

◆ book

python.gnucash_core.book

Definition at line 912 of file gnucash_core.py.

◆ commoditytable_dict

dict python.gnucash_core.commoditytable_dict
Initial value:
1= {
2 'lookup' : GncCommodity,
3 'lookup_unique' : GncCommodity,
4 'find_full' : GncCommodity,
5 'insert' : GncCommodity,
6 'add_namespace': GncCommodityNamespace,
7 'find_namespace': GncCommodityNamespace,
8 }

Definition at line 1007 of file gnucash_core.py.

◆ exc_traceback

python.gnucash_core.exc_traceback

Definition at line 201 of file gnucash_core.py.

◆ exc_type

python.gnucash_core.exc_type

Definition at line 201 of file gnucash_core.py.

◆ exc_value

python.gnucash_core.exc_value

Definition at line 201 of file gnucash_core.py.

◆ get_book

python.gnucash_core.get_book

Definition at line 909 of file gnucash_core.py.

◆ get_commodity_list

python.gnucash_core.get_commodity_list

Definition at line 1027 of file gnucash_core.py.

◆ get_price_db

python.gnucash_core.get_price_db

Definition at line 965 of file gnucash_core.py.

◆ get_root_account

python.gnucash_core.get_root_account

Definition at line 959 of file gnucash_core.py.

◆ get_table

python.gnucash_core.get_table

Definition at line 962 of file gnucash_core.py.

◆ gnc_commodity_dict

dict python.gnucash_core.gnc_commodity_dict
Initial value:
1= {
2 'clone': GncCommodity,
3 'obtain_twin': GncCommodity,
4 'get_namespace_ds': GncCommodityNamespace,
5 }

Definition at line 989 of file gnucash_core.py.

◆ gnc_price_dict

dict python.gnucash_core.gnc_price_dict
Initial value:
1= {
2 'get_commodity': GncCommodity,
3 'get_currency': GncCommodity,
4 'clone': GncPrice,
5 'get_value': GncNumeric,
6 }

Definition at line 997 of file gnucash_core.py.

◆ gnclot_dict

dict python.gnucash_core.gnclot_dict
Initial value:
1= {
2 'get_account' : Account,
3 'get_book' : Book,
4 'get_earliest_split' : Split,
5 'get_latest_split' : Split,
6 'get_balance' : GncNumeric,
7 'lookup' : GncLot,
8 'make_default' : GncLot
9 }

Definition at line 1034 of file gnucash_core.py.

◆ gncnumeric_dict

dict python.gnucash_core.gncnumeric_dict
Initial value:
1= {
2 'same' : GncNumeric,
3 'add' : GncNumeric,
4 'sub' : GncNumeric,
5 'mul' : GncNumeric,
6 'div' : GncNumeric,
7 'neg' : GncNumeric,
8 'abs' : GncNumeric,
9 'add_fixed' : GncNumeric,
10 'sub_fixed' : GncNumeric,
11 'convert' : GncNumeric,
12 'reduce' : GncNumeric,
13 'invert' : GncNumeric
14 }

Definition at line 971 of file gnucash_core.py.

◆ guid_dict

dict python.gnucash_core.guid_dict
Initial value:
1= {
2 'copy' : GUID,
3 'TransLookup': Transaction,
4 'AccountLookup': Account,
5 'SplitLookup': Split
6 }

define addition methods for GUID object - do we need these

Definition at line 1164 of file gnucash_core.py.

◆ lookup_latest_before_t64

python.gnucash_core.lookup_latest_before_t64

Definition at line 767 of file gnucash_core.py.

◆ mode

python.gnucash_core.mode

Definition at line 906 of file gnucash_core.py.

◆ name

python.gnucash_core.name

Definition at line 1152 of file gnucash_core.py.

◆ None

python.gnucash_core.None

Definition at line 906 of file gnucash_core.py.

◆ parent

python.gnucash_core.parent

Definition at line 1105 of file gnucash_core.py.

◆ PriceDB_dict

dict python.gnucash_core.PriceDB_dict
Initial value:
1= {
2 'lookup_latest' : GncPrice,
3 'lookup_nearest_in_time64' : GncPrice,
4 'lookup_nearest_before_t64' : GncPrice,
5 'nth_price' : GncPrice,
6 'lookup_day_t64' : GncPrice,
7 'convert_balance_latest_price' : GncNumeric,
8 'convert_balance_nearest_price_t64' : GncNumeric,
9 'convert_balance_nearest_before_price_t64' : GncNumeric,
10 'get_latest_price' : GncNumeric,
11 'get_nearest_price' : GncNumeric,
12 'get_nearest_before_price' : GncNumeric,
13 }

Definition at line 770 of file gnucash_core.py.

◆ split_dict

dict python.gnucash_core.split_dict
Initial value:
1= {
2 'GetBook': Book,
3 'GetAccount': Account,
4 'GetParent': Transaction,
5 'Lookup': Split,
6 'GetOtherSplit': Split,
7 'GetAmount': GncNumeric,
8 'GetValue': GncNumeric,
9 'GetSharePrice': GncNumeric,
10 'ConvertAmount': GncNumeric,
11 'GetBaseValue': GncNumeric,
12 'GetBalance': GncNumeric,
13 'GetClearedBalance': GncNumeric,
14 'GetReconciledBalance': GncNumeric,
15 'VoidFormerAmount': GncNumeric,
16 'VoidFormerValue': GncNumeric,
17 'GetNoclosingBalance': GncNumeric,
18 'GetCapGains': GncNumeric,
19 'GetGUID': GUID
20 }

Definition at line 1082 of file gnucash_core.py.

◆ this_module_dict

python.gnucash_core.this_module_dict = globals()

Definition at line 915 of file gnucash_core.py.

◆ trans_dict

dict python.gnucash_core.trans_dict
Initial value:
1= {
2 'GetSplit': Split,
3 'FindSplitByAccount': Split,
4 'Clone': Transaction,
5 'Reverse': Transaction,
6 'GetReversedBy': Transaction,
7 'GetImbalanceValue': GncNumeric,
8 'GetAccountValue': GncNumeric,
9 'GetAccountAmount': GncNumeric,
10 'GetAccountConvRate': GncNumeric,
11 'GetAccountBalance': GncNumeric,
12 'GetCurrency': GncCommodity,
13 'GetGUID': GUID
14 }

Definition at line 1055 of file gnucash_core.py.