SetValue ( GncNumeric ( amount, 100 )) # Assuming you only have one split # For multiple splits, you need to make sure the totals all balance out. SetAccount ( lookup_account ( root, "Expenses:Some Expense Account" )) # amount is an int (no $ or. SetParent ( tx ) # The lookup string needs to match your account path exactly. Sp1 = Split ( book ) # First half of transaction SetDescription ( "Transaction Description!" ) #tx.SetNum(int_variable) # if you need a transaction number SetDatePostedTS ( today ) # or another datetime object for the transaction's "register date" get_root_account () # Parent of all accountsĬurrency = book. Note If you are running GnuCashfor the first time, you will be presented with the Welcome to This screen is described in detail in the GnuCashmanual. The New Account Hierarchy setupassistant will start. Note that this is old software from a long time ago. To create a new GnuCashfile do the following: From the GnuCashMenubar, choose File New File. You might also be interested in reading a blog post about it. book # All actions are performed through the book object (or its children) Please view the perldoc for more details. Session = Session ( "/path/to/file.gnucash" ) #, ignore_lock=True) # or use URI string: = datetime. split ( ':' ) return lookup_account_by_path ( root, path ) join ( path ))) if len ( path ) > 1 : return lookup_account_by_path ( acc, path ) return acc get_instance () = None : raise Exception ( 'Account path not found'. from gnucash import Session, Account, Transaction, Split, GncNumeric import gnucashĭef lookup_account_by_path ( parent, path ):Īcc = parent. Then just call the transaction function from your email listener, and you should be in business. You can place all of the transaction code into a function, then hand in whatever data you need to create the two custom transactions. The port is needed only if different from the IETF well known ones for the scheme the path for those two schemes will be the database name supplied when you created the database.Here's a template, along with a couple of account lookup functions which are sorely lacking in the library. mysql and postgres require the hostname including the username and password. The URI format is where scheme is one of file, mysql, or postgres. The datafile can be either a normal file path or a URI. Run: Run the named report in the given GnuCash Show: Describe the options modified in the named namespace arg Regular expression determining which namespace Get: Fetch current quotes for all foreign currenciesĪnd stocks in the given GnuCash datafile. Q arg Execute price quote related commands. logto arg File to log into defaults to "/tmp/ace" LNKin the same directory as your primary What each of these files does is presented below. folder where your saved file resides, you may see other files generated by GnuCashwith the following extensions. log arg Log level overrides, of the form GnuCashcreates several types of files to help ensure that your data is not lost. extra Enable extra/development/debugging features. This is equivalent to: -log "=info" -log "qof=info" debug Enable debugging mode: provide deep detail in the At version 4.11 this produces the following:īin/gnucash-cli - GnuCash, accounting for personal and small business finance: To see the options for the current version use the command gnucash-cli -help. GnuCash has a command-line interface for use in scripts or for performing quick tasks without launching the graphic interface.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |