libwedger 0.1.0 documentation

Interpret the output of ‘ledger’ and make it available in Python

Contents

Interpret the output of ‘ledger’ and make it available in Python

Interfaces to read data from ledger.

libwedger.get_account(account, start=None, end=None)[source]

Get the balance of an account for the given period.

Parameters:
  • account (str) – The name of the account.
  • start (datetime.date) – Date from which to start counting the balance. If omitted, you’ll get the overall balance of the account.
  • end (datetime.date) – Date at which to stop counting the balance. Defaults to datetime.date.today() if omitted.
Returns:

The account balance (including currency symbol or commodity name).

Return type:

str

libwedger.get_all_account_names()[source]

Retrieve the list of account names known to ledger.

Returns:Set of account names.
Return type:{str}
libwedger.get_transaction_register()[source]

Get the list of transactions.

Contents