Koku bindings for node.js
This simple module uses node-applescript to allow easy input and output of data from the Mac OS X finance application Koku. If you use Koku, this wrapper might help you write your own financial information importer (in the absence of first party DirectConnect functionality for your bank) or other utility.
First of all:
npm install koku
var Koku = require("koku"); var kokuInstance = new Koku(); // Asynchronous // Document list // returns array of KokuDocument objects kokuInstance.documents; // Account list // returns array of KokuAccount objects kokuInstance.documents.accounts; // Tags // returns array of KokuTag objects kokuInstance.documents.tags; // Transactions for account kokuInstance.documents.loadTransactions(); // Asynchronous // returns array of KokuTransaction objects kokuInstance.documents.transactions;
...more documentation to come soon.
For the moment, the
KokuAccount.loadTransactions() method is very slow - and as a result will not execute automatically. I'm looking into performance improvements, and refactoring the method, but the issue seems to just be that Apple events are slow.
Koku() constructor and the
KokuAccount.loadTransactions() methods are asynchronous. The former will most likely execute in under ~250msec depending on the size of your Koku library and how many documents you've got open.
KokuTransaction objects are designed to mirror as closely as possible their equivalents in the Koku AppleScript dictionary.