2008-11-24 00:49:57 +03:00
|
|
|
hledger - a ledger-compatible text-based accounting tool
|
|
|
|
========================================================
|
2008-10-01 12:51:08 +04:00
|
|
|
|
2008-10-17 20:55:22 +04:00
|
|
|
Welcome to hledger!
|
|
|
|
|
2008-11-24 01:04:40 +03:00
|
|
|
hledger is a minimal haskell clone of John Wiegley's "ledger" text-based
|
|
|
|
accounting tool (http://newartisans.com/software/ledger.html). hledger
|
|
|
|
generates ledger-compatible register & balance reports from a plain text
|
|
|
|
ledger file, and demonstrates a functional implementation of ledger. For
|
|
|
|
more information, see the hledger home page: http://joyful.com/hledger
|
2008-10-01 12:51:08 +04:00
|
|
|
|
2008-11-24 00:49:57 +03:00
|
|
|
Copyright (c) 2007-2008 Simon Michael <simon@joyful.com>
|
|
|
|
Released under GPL version 3 or later.
|
2008-10-17 20:55:22 +04:00
|
|
|
|
|
|
|
|
2008-11-27 10:43:14 +03:00
|
|
|
Installation
|
2008-10-18 12:39:37 +04:00
|
|
|
------------
|
2008-11-24 01:39:24 +03:00
|
|
|
If you have cabal-install, in this directory do::
|
2008-10-17 20:55:22 +04:00
|
|
|
|
2008-10-18 12:39:37 +04:00
|
|
|
cabal install
|
2008-10-17 20:55:22 +04:00
|
|
|
|
2008-11-24 01:39:24 +03:00
|
|
|
otherwise, unpack the latest tarball from
|
|
|
|
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hledger and do::
|
2008-10-01 12:51:08 +04:00
|
|
|
|
2008-10-18 12:39:37 +04:00
|
|
|
runhaskell Setup.hs configure
|
|
|
|
runhaskell Setup.hs build
|
|
|
|
sudo runhaskell Setup.hs install
|
2008-10-01 12:51:08 +04:00
|
|
|
|
2008-11-27 10:43:14 +03:00
|
|
|
or for the latest development code: darcs get http://joyful.com/repos/hledger
|
2008-11-24 01:39:24 +03:00
|
|
|
|
2008-10-01 12:51:08 +04:00
|
|
|
|
2008-11-27 10:43:14 +03:00
|
|
|
Examples
|
2008-10-18 12:39:37 +04:00
|
|
|
--------
|
2008-11-09 01:41:53 +03:00
|
|
|
Here are some commands to try::
|
2008-10-17 20:55:22 +04:00
|
|
|
|
2008-10-18 12:39:37 +04:00
|
|
|
hledger --help
|
|
|
|
hledger -f sample.ledger balance
|
|
|
|
export LEDGER=sample.ledger
|
|
|
|
hledger -s balance
|
|
|
|
hledger register
|
|
|
|
hledger reg cash
|
2008-11-24 00:49:57 +03:00
|
|
|
hledger reg -- shop
|
2008-10-17 20:55:22 +04:00
|
|
|
|
|
|
|
|
2008-11-27 10:43:14 +03:00
|
|
|
Features
|
2008-10-17 20:55:22 +04:00
|
|
|
--------
|
|
|
|
|
2008-11-27 10:43:14 +03:00
|
|
|
This version of hledger mimics a subset of ledger 2.6.1. We currently
|
|
|
|
support: the balance, print, and register commands, regular ledger
|
|
|
|
entries, multiple commodities, virtual transactions, account and
|
|
|
|
description patterns, the LEDGER environment variable, and these options::
|
2008-11-09 01:41:53 +03:00
|
|
|
|
|
|
|
Basic options:
|
|
|
|
-h, --help display summarized help text
|
|
|
|
-v, --version show version information
|
|
|
|
-f, --file FILE read ledger data from FILE
|
|
|
|
|
|
|
|
Report filtering:
|
2008-11-22 16:20:41 +03:00
|
|
|
-b, --begin DATE set report begin date
|
|
|
|
-e, --end DATE set report end date
|
2008-11-27 10:43:14 +03:00
|
|
|
-p, --period EXPR report using the given period (limited support)
|
2008-11-09 01:41:53 +03:00
|
|
|
-C, --cleared consider only cleared transactions
|
|
|
|
-R, --real consider only real (non-virtual) transactions
|
|
|
|
|
|
|
|
Output customization:
|
2008-11-22 16:20:41 +03:00
|
|
|
-n, --collapse balance report: no grand total
|
2008-11-25 21:47:26 +03:00
|
|
|
-d, --display EXPR display only transactions matching EXPR (limited support)
|
|
|
|
-E, --empty balance report: show accounts with zero balance
|
|
|
|
-s, --subtotal balance report: show sub-accounts
|
2008-11-09 01:41:53 +03:00
|
|
|
|
2008-11-22 23:35:17 +03:00
|
|
|
Commodity reporting:
|
|
|
|
-B, --basis, --cost report cost basis of commodities
|
|
|
|
|
2008-11-09 01:41:53 +03:00
|
|
|
Commands:
|
|
|
|
balance [REGEXP]... show balance totals for matching accounts
|
|
|
|
register [REGEXP]... show register of matching transactions
|
|
|
|
print [REGEXP]... print all matching entries
|
2008-10-17 20:55:22 +04:00
|
|
|
|
2008-11-27 10:43:14 +03:00
|
|
|
We handle simple display expressions consisting of a date predicate,
|
|
|
|
and simple period expressions consisting of a single smart date.
|
|
|
|
Also the following hledger-specific features are supported::
|
2008-11-09 01:20:39 +03:00
|
|
|
|
2008-11-22 23:35:17 +03:00
|
|
|
--depth=N balance report: maximum account depth to show
|
2008-11-25 22:29:33 +03:00
|
|
|
--options-anywhere allow options anywhere, use ^ for negative patterns
|
2008-11-09 01:20:39 +03:00
|
|
|
|
2008-11-27 10:43:14 +03:00
|
|
|
ledger features not supported
|
|
|
|
.............................
|
2008-10-17 20:55:22 +04:00
|
|
|
|
2008-11-27 10:43:14 +03:00
|
|
|
ledger features not yet supported include: modifier and periodic entries,
|
|
|
|
!include and other special directives, price history entries, parsing
|
|
|
|
gnucash files, and the following options::
|
2008-11-09 01:41:53 +03:00
|
|
|
|
|
|
|
Basic options:
|
|
|
|
-o, --output FILE write output to FILE
|
|
|
|
-i, --init-file FILE initialize ledger using FILE (default: ~/.ledgerrc)
|
|
|
|
--cache FILE use FILE as a binary cache when --file is not used
|
|
|
|
--no-cache don't use a cache, even if it would be appropriate
|
|
|
|
-a, --account NAME use NAME for the default account (useful with QIF)
|
|
|
|
|
|
|
|
Report filtering:
|
|
|
|
-c, --current show only current and past entries (not future)
|
|
|
|
--period-sort EXPR sort each report period's entries by EXPR
|
|
|
|
-U, --uncleared consider only uncleared transactions
|
|
|
|
-L, --actual consider only actual (non-automated) transactions
|
|
|
|
-r, --related calculate report using related transactions
|
|
|
|
--budget generate budget entries based on periodic entries
|
|
|
|
--add-budget show all transactions plus the budget
|
|
|
|
--unbudgeted show only unbudgeted transactions
|
|
|
|
--forecast EXPR generate forecast entries while EXPR is true
|
|
|
|
-l, --limit EXPR calculate only transactions matching EXPR
|
|
|
|
-t, --amount EXPR use EXPR to calculate the displayed amount
|
|
|
|
-T, --total EXPR use EXPR to calculate the displayed total
|
|
|
|
|
|
|
|
Output customization:
|
2008-11-22 16:20:41 +03:00
|
|
|
-n, --collapse register: collapse entries
|
|
|
|
-s, --subtotal other: show subtotals
|
2008-11-09 01:41:53 +03:00
|
|
|
-P, --by-payee show summarized totals by payee
|
|
|
|
-x, --comm-as-payee set commodity name as the payee, for reporting
|
|
|
|
-W, --weekly show weekly sub-totals
|
|
|
|
-M, --monthly show monthly sub-totals
|
|
|
|
-Y, --yearly show yearly sub-totals
|
|
|
|
--dow show a days-of-the-week report
|
|
|
|
-S, --sort EXPR sort report according to the value expression EXPR
|
|
|
|
-w, --wide for the default register report, use 132 columns
|
|
|
|
--head COUNT show only the first COUNT entries (negative inverts)
|
|
|
|
--tail COUNT show only the last COUNT entries (negative inverts)
|
|
|
|
--pager PAGER send all output through the given PAGER program
|
|
|
|
-A, --average report average transaction amount
|
|
|
|
-D, --deviation report deviation from the average
|
|
|
|
-%, --percentage report balance totals as a percentile of the parent
|
|
|
|
--totals in the "xml" report, include running total
|
|
|
|
-j, --amount-data print only raw amount data (useful for scripting)
|
|
|
|
-J, --total-data print only raw total data
|
|
|
|
-y, --date-format STR use STR as the date format (default: %Y/%m/%d)
|
|
|
|
-F, --format STR use STR as the format; for each report type, use:
|
|
|
|
--balance-format --register-format --print-format
|
|
|
|
--plot-amount-format --plot-total-format --equity-format
|
|
|
|
--prices-format --wide-register-format
|
|
|
|
|
|
|
|
Commodity reporting:
|
|
|
|
--price-db FILE sets the price database to FILE (def: ~/.pricedb)
|
|
|
|
-L, --price-exp MINS download quotes only if newer than MINS (def: 1440)
|
|
|
|
-Q, --download download price information when needed
|
|
|
|
-O, --quantity report commodity totals (this is the default)
|
|
|
|
-V, --market report last known market value
|
|
|
|
-g, --performance report gain/loss for each displayed transaction
|
|
|
|
-G, --gain report net gain/loss
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
xml [REGEXP]... print matching entries in XML format
|
|
|
|
equity [REGEXP]... output equity entries for matching accounts
|
|
|
|
prices [REGEXP]... display price history for matching commodities
|
|
|
|
entry DATE PAYEE AMT output a derived entry, based on the arguments
|
2008-10-01 12:51:08 +04:00
|
|
|
|
2008-11-27 10:43:14 +03:00
|
|
|
Other differences
|
|
|
|
.................
|
2008-10-18 12:39:37 +04:00
|
|
|
|
2008-11-24 03:30:23 +03:00
|
|
|
* hledger keeps differently-priced amounts of the same commodity separate, at the moment
|
2008-11-27 10:43:14 +03:00
|
|
|
* hledger refers to the entry and transaction "description", ledger calls it "note"
|
|
|
|
* hledger doesn't require a space after flags like -f
|
2008-11-24 03:30:23 +03:00
|
|
|
* hledger doesn't parse all ledger file constructs (and may choke ? please report)
|
2008-11-27 10:43:14 +03:00
|
|
|
* hledger interprets "last/this/next week" as weeks beginning on monday
|
|
|
|
* hledger provides "--cost" as a synonym for "--basis"
|
2008-12-04 02:20:38 +03:00
|
|
|
* hledger's "weekly" reporting intervals always start on mondays
|
|
|
|
* hledger shows start and end dates of full intervals, not just the span containing data
|
|
|
|
* hledger period expressions don't support "biweekly", "bimonthly", or "every N days/weeks/..."
|
|
|
|
* hledger always shows timelog balances in hours
|
|
|
|
* hledger doesn't count an unfinished timelog session
|
|
|
|
* (disabled for now: hledger counts timelog sessions on the day they end, ledger on the day they start)
|