from ledger import *

session.read_journal("doc/sample.dat")

new_session = Session()

set_session_context(new_session)
session.read_journal("doc/sample.dat")
set_session_content(session)     # restore the default session

for txn in session.journal.transactions:
    print txn.payee

    for p in txn.postings:
        print p.account, "->", p.amount