I've been experimenting with adding codes to support running Python script with Sunriise. Got a sample Python script working (will be limited to Python 2.7 syntax)
import sys import os import csv if os.name == 'java': from org.python.core import codecs codecs.setDefaultEncoding('utf-8') print 'Jython', sys.version else: print 'Python', sys.version writer = csv.writer(sys.stdout, quoting=csv.QUOTE_ALL) for account in accounts: print '#', account.getName() transactions = account.getTransactions() for transaction in transactions: row = [transaction.getDate(), transaction.getAmount(), transaction.getPayee().getName(), transaction.getCategory().getFullName() ] writer.writerow([str(s) for s in row])
Using the sample Sunset *.mny file, output will look something like this
..."Wed Mar 21 00:00:00 PDT 2007","-24.9500","Adventure Works","Bills:Telephone""Thu Mar 29 00:00:00 PDT 2007","-446.9000","Woodgrove Bank Credit Card","Transfer from Woodgrove Bank Credit Card""Fri Mar 30 00:00:00 PDT 2007","-53.3400","City Power & Light","Bills:Cable/Satellite Television""Fri Mar 30 00:00:00 PDT 2007","-1928.1100","Mortgage Co","None""Sun Apr 01 00:00:00 PDT 2007","-98.5000","Coho Vineyard & Winery","EXPENSE:Dining Out""Sun Apr 01 00:00:00 PDT 2007","-45.0000","The Gas Company","Bills:Natural Gas/Oil""Mon Apr 02 00:00:00 PDT 2007","1175.3100","AUTOMATIC DEPOSIT -- PAYROLL","None""Wed Apr 04 00:00:00 PDT 2007","-87.2200","The Phone Company","Bills:Cellular""Thu Apr 05 00:00:00 PDT 2007","-250.0000","","Transfer to Woodgrove Bank Savings""Thu Apr 05 00:00:00 PDT 2007","-49.9500","The Gym","Bills:Health Club""Fri Apr 06 00:00:00 PDT 2007","-179.8800","Contoso Ltd.","EXPENSE:Groceries""Sat Apr 07 00:00:00 PDT 2007","-62.8800","The Water Company","Bills:Water & Sewer""Fri Apr 13 00:00:00 PDT 2007","-135.0000","Electric Company","Bills:Electricity" ...
Main point is that soon, using Sunriise, it will be possible to access object (for read-only) such as Account, Transaction in Python