public
Description: A port of the Ledger data architecture to Haskell
Homepage: http://hledger.org/Hledger
Clone URL: git://github.com/jwiegley/hledger.git
name age message
file ANSICommand.hs Mon Jan 19 20:28:16 -0800 2009 remove stray vty code from ansi command 20090... [simonmichael]
file BalanceCommand.hs Sun Mar 15 04:12:29 -0700 2009 a new balance report implementation that passes... [simonmichael]
file LICENSE Wed Oct 01 00:52:07 -0700 2008 add LICENSE 20081001075207-3c3f9-63306b899020... [simonmichael]
file Ledger.hs Wed Nov 26 16:35:00 -0800 2008 gather date stuff together, FuzzyDate -> SmartD... [simonmichael]
directory Ledger/ Sun Mar 15 05:42:03 -0700 2009 test and bugfix for multi-day timelog session s... [simonmichael]
file Makefile Sun Mar 15 01:47:23 -0700 2009 tweak doctest output, and compile it 20090315... [simonmichael]
file NEWS Sat Jan 17 15:59:42 -0800 2009 news correction 20090117235942-3c3f9-65917238... [simonmichael]
file NOTES Sun Mar 15 05:42:03 -0700 2009 test and bugfix for multi-day timelog session s... [simonmichael]
file Options.hs Sun Mar 15 04:09:49 -0700 2009 move the big limit into depthFromOpts 2009031... [simonmichael]
file PrintCommand.hs Tue Nov 25 11:29:33 -0800 2008 --options-anywhere to use ^ for negative patter... [simonmichael]
file README Thu Feb 26 20:03:14 -0800 2009 docs 20090227040314-3c3f9-01c8633c521e44708b5... [simonmichael]
file RegisterCommand.hs Sun Mar 15 04:09:49 -0700 2009 move the big limit into depthFromOpts 2009031... [simonmichael]
file Setup.hs Thu Oct 09 18:53:39 -0700 2008 clean up imports whitespace, minimise explicit ... [simonmichael]
file Tests.hs Sun Mar 15 05:42:03 -0700 2009 test and bugfix for multi-day timelog session s... [simonmichael]
file UICommand.hs Mon Jan 19 19:48:23 -0800 2009 vty ui docs 20090120034823-3c3f9-60f950894211... [simonmichael]
file Utils.hs Sat Jan 24 23:06:59 -0800 2009 count time elapsed in open timelog entries, ign... [simonmichael]
file VERSION Thu Feb 26 18:55:54 -0800 2009 another iteration of the version number system;... [simonmichael]
file Version.hs Thu Feb 26 21:50:12 -0800 2009 simplify PATCHES handling, fixes "make ci" 20... [simonmichael]
file WebCommand.hs Fri Feb 13 12:45:32 -0800 2009 fix cabal dependencies for the web command 20... [simonmichael]
file bench.tests Sat Jan 17 10:40:27 -0800 2009 streamline bench tests, generate test ledgers ... [simonmichael]
directory data/ Mon May 26 14:19:21 -0700 2008 support tools cleanup 20080526211921-3c3f9-d6... [simonmichael]
directory doc/ Wed Oct 01 02:32:02 -0700 2008 show Main module in api docs by default 20081... [simonmichael]
file hledger.cabal Thu Feb 26 21:50:12 -0800 2009 simplify PATCHES handling, fixes "make ci" 20... [simonmichael]
file hledger.hs Thu Feb 26 19:09:16 -0800 2009 comments 20090227030916-3c3f9-b5768a451e2b29c... [simonmichael]
directory profs/ Mon May 26 14:19:21 -0700 2008 support tools cleanup 20080526211921-3c3f9-d6... [simonmichael]
file sample.ledger Fri Dec 05 03:09:09 -0800 2008 update sample.ledger 20081205110909-3c3f9-dcb... [simonmichael]
directory tools/ Sun Mar 15 01:47:23 -0700 2009 tweak doctest output, and compile it 20090315... [simonmichael]
README
hledger - a ledger-compatible text-based accounting tool
========================================================

Welcome to hledger! 

hledger is a haskell clone of John Wiegley's "ledger" text-based
accounting tool (http://newartisans.com/software/ledger.html).  
It generates ledger-compatible register & balance reports from a plain
text ledger file, and demonstrates a functional implementation of ledger.
For more information, see hledger's home page: http://joyful.com/hledger

Copyright (c) 2007-2009 Simon Michael <simon@joyful.com>
Released under GPL version 3 or later.


Installation
------------
hledger requires GHC. It is known to build with 6.8 and 6.10.
If you have cabal-install, do::

 cabal update
 cabal install hledger

Otherwise, unpack the latest tarball from
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hledger and do::

 runhaskell Setup.hs configure
 runhaskell Setup.hs build
 sudo runhaskell Setup.hs install 

This will complain about any missing libraries, which you can download and
install manually from hackage.haskell.org. The Build-Depends: in
hledger.cabal has the full package list. 

You can configure with optional flags to build additional hledger
features. These are::

  -f vty   - Build vty-based text ui (requires vty, not available on windows)
  -f ansi  - Build ansi-based text ui (requires ansi-terminal)
  -f happs - Build happs-based web ui (requires HApps-Server)

Eg::

 cabal install -f "vty ansi happs" hledger (or runhaskell Setup.hs configure -f "vty ansi happs")

To get the latest development code do::

 darcs get http://joyful.com/repos/hledger


Usage
-----
hledger looks for your ledger file at ~/.ledger by default. To use a
different file, specify it with the LEDGER environment variable or -f
option (which may be - for standard input). Here are some commands to
try::

 hledger --help
 hledger -f sample.ledger balance
 export LEDGER=sample.ledger
 hledger -s balance
 hledger register
 hledger reg cash
 hledger reg -- shop
 hledger ui


Time reporting
--------------
hledger can parse a timelog file in timeclock.el's format, treating
time categories as accounts. If hledger is invoked by the "hours"
alias it looks for your timelog (~/.timelog, or the file specified by
$TIMELOG or -f), and parses arguments slightly differently for
convenient querying::

 hours [OPTIONS] [PERIOD [COMMAND [PATTERNS]]]

PERIOD and COMMAND default to "today" and "balance --subtotal" respectively.
Examples::

 hours                                 # today's balances
 hours today                           # the same
 hours 'this week'                     # so far this week
 hours week                            # the same
 hours lastmonth                       # last month, the space is optional
 hours 'from 1/15'                     # from jan 15
 hours 'monthly in 2008' reg --depth 1 # monthly register, top-level only

Features
--------

This version of hledger mimics a subset of ledger 2.6.1, and adds some
features of its own. 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::

   Basic options:
   -h, --help             display summarized help text
   -v, --version          show version information
   -f, --file FILE        read ledger data from FILE
 
   Report filtering:
   -b, --begin DATE       set report begin date
   -e, --end DATE         set report end date
   -p, --period EXPR      report using the given period
   -C, --cleared          consider only cleared transactions
   -R, --real             consider only real (non-virtual) transactions
 
   Output customization:
   -n, --collapse         balance report: no grand total
   -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
 
   Commodity reporting:
   -B, --basis, --cost    report cost basis of commodities

   Commands:
   balance  [REGEXP]...   show balance totals for matching accounts
   register [REGEXP]...   show register of matching transactions
   print    [REGEXP]...   print all matching entries

We handle (almost) the full period expression syntax, and simple display
expressions consisting of a date predicate.  Also the following
hledger-specific features are supported::

   ui                     a simple curses-based text ui (unix platforms only)
   ansi                   an even more rudimentary ansi-based text ui
   web                    a simple web interface on port 5000
   --depth=N              balance report: maximum account depth to show

ledger features not supported
.............................

ledger features not yet supported include: modifier and periodic entries,
parsing gnucash files, and the following options::

   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:
   -n, --collapse         register: collapse entries
   -s, --subtotal         other: show subtotals
   -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

Other differences
.................

* hledger accepts options anywhere on the command line. Instead of - and --
  for pattern negation and separation, use ^ and ^^.
* hledger always keeps differently-priced amounts of the same commodity separate
* hledger calls ledger's "note" field "description"
* hledger doesn't require a space before command-line option values, eg: -f-
* hledger provides "--cost" as a synonym for "--basis"
* hledger's weekly reporting intervals always start on mondays
* hledger shows start and end dates of the intervals requested, 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