Slots of type GUID use the name of the slot to do the conversion back and forth between an object and its guid. : slot= has key=myintkey and value=3 of type slot= has key=mystrkey and value=hello of type slot= has key=myboolkey and value=True of type slot= has key=mydatekey and value= of type slot= has key=mydatetimekey and value= 08:50:06.855673 of type slot= has key=mynumerickey and value=12.34567 of type slot=> has key=account and value=Account of type # delete a slot In : del book # delete all slots In : del book # create a key/value in a slot frames (and create them if they do not exist) In : book = "t" # access a slot in frame in whatever notations In : s1 = book In : s2 = book In : s3 = book In : s4 = book In : assert s1 = s2 = s3 = s4 children In : print ( acc ) Account # accessing attributes of an account In : print ( f "Account name= ". root_account In : print ( root ) Account # accessing the first children account of a book In : acc = root. In : book = open_book ( gnucash_books + "simple_sample.gnucash", open_if_lock = True ) # accessing the root_account In : root = book. transactions Out: Įach of these collections can be either iterated or accessed through some indexation or filter mechanism (returnįirst element of collection satisfying some criteria(s)): commodities Out: # accessing all transactions In : book. accounts Out: # accessing all commodities In : book. In : book = open_book ( gnucash_books + "default_book.gnucash" ) # accessing all accounts In : book. : Account Account Account Account Account Account Account Account Account Account : Commodity In : # get first ten accounts linked to the commodity commo. validate source ¶ This must be reimplemented for object requiring validation. split.objecttovalidate should yeild both ansaction and split.lot. These accounts are created automatically when a transaction is entered which has a debit to an account. There will be one such account for each currency which is involved in the Gnucash file. To get the numerical value for the amount of splits in a list of accounts use gnc:accounts-count-splits defined in report. 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). Trading Accounts are used to represent the imbalances caused by a transaction involving two different currencies, as described in the Tutorial.
A non-split transaction is a transaction consisting of a single split. Note that in GnuCash each transaction is a split even if it is not a split transaction. : Account In : # get the commodity of an account. Returns the the list of transactions in a given account. children ( type = "CASH" ) # select child account by type. children # select child account by index. children ( name = "Assets" ) # select child account by name. : Account Account Account Account Account # accessing children accounts In. root_account # accessing the root_account Out: Account In : # looping through the children accounts of the root_account. In : book = open_book ( gnucash_books + "default_book.gnucash" ) In : book.