MD 2015 Python Interface problem
I assume that the Python Interface extension distributed with Moneydance 2015 should be operational.
I have tried several of the python scripts on the Extension Development page and none of them seem to work.
This simple script fails with the following error
ra = moneydance.getRootAccount()
acct = ra.getAccountByName('Complete Access')
bal=str(acct.getBalance())
print acct.getAccountName()+' $'+bal[0:-2]+'.'+bal[-2:]
# SCRIPT WORKS AS EXPECTED UP TO THIS POINT
txns = ra.getTransactionSet().getTransactionsForAccount(acct).getAllTxns()
# SCRIPT FAILS ON LINE ABOVE WITH
# Attributeerror: getTransactionSet
for txn in txns:
print repr(txn)
I'm not sure if the Python Interface Extension is ready for prime time yet but it will be great once its working as python scripting is so handy
Thanks
Allan
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
1 Posted by allangdavies on 07 May, 2015 01:54 PM
PS I have tried this on 2015.3 (1175) and 2015.4 (1205)
Support Staff 2 Posted by Sean Reilly on 07 May, 2015 02:44 PM
Hi Allan,
Sorry about that. The python extension itself is fine, but the example scripts haven't yet been updated to work with the new API that is available in MD2015.
Thanks,
Sean
3 Posted by allangdavies on 07 May, 2015 11:06 PM
Hi Sean
Thanks for the heads up. Just a clarification - does the API documentation - http://infinitekind.com/dev/apidoc/index.html - from your Developer page reflect the MD 2015 API?
Allan
PS thanks for the great work on this application. I've tried so many applications over the years and this is best and most flexible solution I've found.
Support Staff 4 Posted by Sean Reilly on 08 May, 2015 02:53 PM
Hi Allan,
Thanks for the kind words! Yes, that URL does point to the Moneydance 2015 documentation.
Cheers,
Sean
5 Posted by Patrick on 01 Jun, 2015 06:56 AM
I can't get my code to work from MD 2014 in MD 2015. Is there any migration guide please?
ie:
# SCRIPT WORKS AS EXPECTED UP TO THIS POINT
txns = ra.getTransactionSet().getTransactionsForAccount(acct).getAllTxns()
# SCRIPT FAILS ON LINE ABOVE WITH
# Attributeerror: getTransactionSet
6 Posted by allangdavies on 01 Jun, 2015 07:53 AM
This works for me in MD2015
root=moneydance.getCurrentAccountBook()
ra = root.getRootAccount()
acct = ra.getAccountByName(accountname)
txns = root.getTransactionSet().getTransactionsForAccount(acct)
Cheers
Allan
7 Posted by Patrick on 01 Jun, 2015 10:07 AM
Thanks you very much that goes a step further.
Now ra.getSubAccounts() used to get all subaccounts and now it only gets the first level. Any ideas how this can be fixed please?
On another note: How on earth can the whole API be changed in 2015 and not any of the samples?? ie: http://infinitekind.com/developer
http://infinitekind.com/dev/RM-NetWorth/txntest.html
8 Posted by allangdavies on 02 Jun, 2015 12:09 AM
Hi Patrick
Glad that helped. Like you, I am experimenting with the Python interface and worked out the code I sent you from an example I saw in the forum.
I haven’t got any sub accounts so have not tried experimenting with retrieving them.
I would recommend studying the new data model (http://infinitekind.com/dev/apidoc/index.html <http://infinitekind.com/dev/apidoc/index.html>) which is how I’m discovering the interface. I am sure the infinitekind team will update the example scripts eventually.
Allan
System closed this discussion on 19 Mar, 2016 04:55 AM.