Exemple #1
0
def main(argv):
    opts, _ = getopt.getopt(argv, "d:")
    parse_directory = None
    print opts
    for opt, arg in opts:
        if opt == '-d':
            parse_directory = arg
    print "parsing {}".format(parse_directory)
    statement = Statement()
    names_to_accounts = get_directories_to_accounts()
    print names_to_accounts
    ofx = Ofx()
    ofx.accounts = []
    ofx.headers = {}
    ofx.signon = None
    ofx.trnuid = 0
    ofx.status = {
        "code": 0,
        "severity": "INFO",
    }
    for name, account_id in names_to_accounts.iteritems():
        account_transactions = get_transactions_from_named_directory(name, account_id, parse_directory)
        if len(account_transactions.statement.transactions) > 0:
            ofx.accounts.append(account_transactions)
        else:
            print "Did not find any transactions for {}".format(name)

    printer = OfxPrinter(ofx, "testing.ofx")
    printer.write()
Exemple #2
0
    def __init__(self, account_id):
        self.account = Account()
        self.account.account_id = account_id
        self.account.statement = Statement()
        self.account.statement.available_balance = None
        self.account.statement.available_balance_date = None
        self.account.statement.balance = None
        self.account.statement.balance_date = None

        self.date_transaction_counters = {}
Exemple #3
0
 def testThatANewStatementIsValid(self):
     statement = Statement()
     self.assertEquals('', statement.start_date)
     self.assertEquals('', statement.end_date)
     self.assertEquals(0, len(statement.transactions))