Accessing Budget Item Detail

kerwin's Avatar

kerwin

Jan 05, 2018 @ 11:42 PM

I am trying to access the budget data through python interpreter.

I can only access the budget items which has limited detail through the following code. Can you suggest a way I can access budget item detail through python objects?

#!/usr/bin/env python
# Python script to be run in Moneydance to perform amazing feats of financial scripting

from com.infinitekind.moneydance.model import *

import sys
import time
import csv

# get the default environment variables, set by Moneydance
print "The Moneydance app controller: %s"%(moneydance)
print "The current data set: %s"%(moneydance_data)
print "The UI: %s"%(moneydance_ui)

if moneydance_data:
  txnSet = moneydance_data.getTransactionSet()
if moneydance:
book = moneydance.getCurrentAccountBook()
budget = book.getBudgets().findCurrentBudget()
budgetitemlist = budget.getItemList()

xcounter=0
for txn in txnSet.iterableTxns():
if xcounter < 10:
print((txn.getDateInt(), txn.getBook(),txn.getAccount(),txn.getDescription(), txn.getAccount().getCurrencyType().formatFancy(txn.getValue(), '.')))
xcounter += 1

icounter = 0
for budgetitem in budgetitemlist.iterator():
if icounter < 10:
print(budgetitem.getBudget(),budgetitem.getAccount(),budgetitem.getInterval(),budgetitem.getIntervalEndDate(),budgetitem.getAmount())
icounter +=1

  1. System closed this discussion on Apr 06, 2018 @ 11:50 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac