ledger_cli 0.2.3 ledger_cli: ^0.2.3 copied to clipboard
Parse ledger-cli ledger files
Parse ledger-cli ledger files.
This is a work in progress.
Usage #
The simplest way to parse a ledger file is to pass it to LedgerLoader
, like so:
final source = LedgerSource.forFile('/path/to/ledger/file');
final ledger = await ledgerFileLoader.load(source, onApplyFailure: (edit, exc, stackTrace) {
print("ERROR: could not apply $edit: $exc\n$stackTrace");
});
print("Found a ledger with entries: ${ledger.entries} and accounts: ${ledger.accountManager.accounts.values}");
Currently only basic parsing of a single file is supported, with simple queries.
See also ledger_cli_flutter.