mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-29 13:22:27 +03:00
doc: regenerate hledger docs
This commit is contained in:
parent
b7092f278b
commit
f1ec6a6647
@ -2205,358 +2205,74 @@ options, etc.
|
||||
.PP
|
||||
Here are some hledger add\-ons available from Hackage, the extra
|
||||
directory in the hledger source, or elsewhere:
|
||||
.SS Official add\-ons
|
||||
.PP
|
||||
These are maintained and released along with hledger.
|
||||
.SS api
|
||||
.PP
|
||||
Web API server, see hledger\-api.
|
||||
.SS autosync
|
||||
.PP
|
||||
Download OFX bank data and/or convert OFX to hledger journal format.
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ hledger\ autosync\ \-\-help
|
||||
usage:\ hledger\-autosync\ [\-h]\ [\-m\ MAX]\ [\-r]\ [\-a\ ACCOUNT]\ [\-l\ LEDGER]\ [\-i\ INDENT]
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [\-\-initial]\ [\-\-fid\ FID]\ [\-\-assertions]\ [\-d]\ [\-\-hledger]
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [\-\-slow]\ [\-\-which]
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [PATH]
|
||||
|
||||
Synchronize\ ledger.
|
||||
|
||||
positional\ arguments:
|
||||
\ \ PATH\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ do\ not\ sync;\ import\ from\ OFX\ file
|
||||
|
||||
optional\ arguments:
|
||||
\ \ \-h,\ \-\-help\ \ \ \ \ \ \ \ \ \ \ \ show\ this\ help\ message\ and\ exit
|
||||
\ \ \-m\ MAX,\ \-\-max\ MAX\ \ \ \ \ maximum\ number\ of\ days\ to\ process
|
||||
\ \ \-r,\ \-\-resync\ \ \ \ \ \ \ \ \ \ do\ not\ stop\ until\ max\ days\ reached
|
||||
\ \ \-a\ ACCOUNT,\ \-\-account\ ACCOUNT
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ account\ name\ for\ import
|
||||
\ \ \-l\ LEDGER,\ \-\-ledger\ LEDGER
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify\ ledger\ file\ to\ READ\ for\ syncing
|
||||
\ \ \-i\ INDENT,\ \-\-indent\ INDENT
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ number\ of\ spaces\ to\ use\ for\ indentation
|
||||
\ \ \-\-initial\ \ \ \ \ \ \ \ \ \ \ \ \ create\ initial\ balance\ entries
|
||||
\ \ \-\-fid\ FID\ \ \ \ \ \ \ \ \ \ \ \ \ pass\ in\ fid\ value\ for\ OFX\ files\ that\ do\ not\ supply\ it
|
||||
\ \ \-\-assertions\ \ \ \ \ \ \ \ \ \ create\ balance\ assertion\ entries
|
||||
\ \ \-d,\ \-\-debug\ \ \ \ \ \ \ \ \ \ \ enable\ debug\ logging
|
||||
\ \ \-\-hledger\ \ \ \ \ \ \ \ \ \ \ \ \ force\ use\ of\ hledger\ (on\ by\ default\ if\ invoked\ as\ hledger\-
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ autosync)
|
||||
\ \ \-\-slow\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ use\ slow,\ but\ possibly\ more\ robust,\ method\ of\ calling\ ledger
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (no\ subprocess)
|
||||
\ \ \-\-which\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ display\ which\ version\ of\ ledger/hledger/ledger\-python\ will
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ be\ used\ by\ ledger\-autosync\ to\ check\ for\ previous
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ transactions
|
||||
$\ head\ acct1.ofx
|
||||
OFXHEADER:100
|
||||
DATA:OFXSGML
|
||||
VERSION:102
|
||||
SECURITY:NONE
|
||||
ENCODING:USASCII
|
||||
CHARSET:1252
|
||||
COMPRESSION:NONE
|
||||
OLDFILEUID:NONE
|
||||
NEWFILEUIDe:8509488b59d1bb45
|
||||
|
||||
$\ hledger\ autosync\ acct1.ofx
|
||||
2013/08/30\ MONTHLY\ SERVICE\ FEE
|
||||
\ \ \ \ ;\ ofxid:\ 3000.4303001832.201308301
|
||||
\ \ \ \ WF:4303001832\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \-$6.00
|
||||
\ \ \ \ [assets:business:bank:wf:bchecking:banking]\ \ $6.00
|
||||
\f[]
|
||||
.fi
|
||||
.PP
|
||||
ledger\-autosync, which includes a \f[C]hledger\-autosync\f[] alias,
|
||||
downloads transactions from your bank(s) via OFX, and prints just the
|
||||
new ones as journal entries which you can add to your journal.
|
||||
It can also operate on .OFX files which you\[aq]ve downloaded manually.
|
||||
It can be a nice alternative to hledger\[aq]s built\-in CSV reader,
|
||||
especially if your bank supports OFX download.
|
||||
.SS diff
|
||||
.PP
|
||||
Show transactions present in one journal file but not another
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ hledger\ diff\ \-\-help
|
||||
Usage:\ hledger\-diff\ account:name\ left.journal\ right.journal
|
||||
$\ cat\ a.journal
|
||||
1/1
|
||||
\ (acct:one)\ \ 1
|
||||
|
||||
$\ cat\ b.journal
|
||||
1/1
|
||||
\ (acct:one)\ \ 1
|
||||
2/2
|
||||
\ (acct:two)\ \ 2
|
||||
|
||||
$\ hledger\ diff\ acct:two\ a.journal\ b.journal
|
||||
Unmatched\ transactions\ in\ the\ first\ journal:
|
||||
|
||||
Unmatched\ transactions\ in\ the\ second\ journal:
|
||||
|
||||
2015/02/02
|
||||
\ \ \ \ (acct:two)\ \ \ \ \ \ \ \ \ \ \ \ $2
|
||||
\f[]
|
||||
.fi
|
||||
.PP
|
||||
hledger\-diff compares two journal files.
|
||||
Given an account name, it prints out the transactions affecting that
|
||||
account which are in one journal file but not in the other.
|
||||
This can be useful for reconciling existing journals with bank
|
||||
statements.
|
||||
.SS equity
|
||||
.PP
|
||||
Print a journal entry that resets account balances to zero.
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ hledger\ balance\ \-\-flat\ \-E\ assets\ liabilities
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0\ \ assets:bank:checking
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $1\ \ assets:bank:saving
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\-2\ \ assets:cash
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $1\ \ liabilities:debts
|
||||
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0
|
||||
$\ hledger\ equity\ assets\ liabilities
|
||||
2015/05/23
|
||||
\ \ \ \ assets:bank:saving\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\-1
|
||||
\ \ \ \ assets:cash\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $2
|
||||
\ \ \ \ liabilities:debts\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\-1
|
||||
\ \ \ \ equity:closing\ balances\ \ \ \ \ \ \ \ \ \ \ \ \ 0
|
||||
|
||||
2015/05/23
|
||||
\ \ \ \ assets:bank:saving\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $1
|
||||
\ \ \ \ assets:cash\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\-2
|
||||
\ \ \ \ liabilities:debts\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $1
|
||||
\ \ \ \ equity:opening\ balances\ \ \ \ \ \ \ \ \ \ \ \ \ 0
|
||||
\f[]
|
||||
.fi
|
||||
.PP
|
||||
This prints a journal entry which zeroes out the specified accounts (or
|
||||
all accounts) with a transfer to/from "equity:closing balances" (like
|
||||
Ledger\[aq]s equity command).
|
||||
Also, it prints an similar entry with opposite sign for restoring the
|
||||
balances from "equity:opening balances".
|
||||
.PP
|
||||
These can be useful for ending one journal file and starting a new one,
|
||||
respectively.
|
||||
By zeroing your asset and liability accounts at the end of a file and
|
||||
restoring them at the start of the next one, you will see correct
|
||||
asset/liability balances whether you run hledger on just one file, or on
|
||||
several files concatenated with include.
|
||||
.SS interest
|
||||
.PP
|
||||
Generate interest transactions.
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ hledger\ interest\ \-\-help
|
||||
Usage:\ hledger\-interest\ [OPTION...]\ ACCOUNT
|
||||
\ \ \-h\ \ \ \ \ \ \ \ \ \ \-\-help\ \ \ \ \ \ \ \ \ \ \ \ print\ this\ message\ and\ exit
|
||||
\ \ \-V\ \ \ \ \ \ \ \ \ \ \-\-version\ \ \ \ \ \ \ \ \ show\ version\ number\ and\ exit
|
||||
\ \ \-v\ \ \ \ \ \ \ \ \ \ \-\-verbose\ \ \ \ \ \ \ \ \ echo\ input\ ledger\ to\ stdout\ (default)
|
||||
\ \ \-q\ \ \ \ \ \ \ \ \ \ \-\-quiet\ \ \ \ \ \ \ \ \ \ \ don\[aq]t\ echo\ input\ ledger\ to\ stdout
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \-\-today\ \ \ \ \ \ \ \ \ \ \ compute\ interest\ up\ until\ today
|
||||
\ \ \-f\ FILE\ \ \ \ \ \-\-file=FILE\ \ \ \ \ \ \ input\ ledger\ file\ (pass\ \[aq]\-\[aq]\ for\ stdin)
|
||||
\ \ \-s\ ACCOUNT\ \ \-\-source=ACCOUNT\ \ interest\ source\ account
|
||||
\ \ \-t\ ACCOUNT\ \ \-\-target=ACCOUNT\ \ interest\ target\ account
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \-\-act\ \ \ \ \ \ \ \ \ \ \ \ \ use\ \[aq]act\[aq]\ day\ counting\ convention
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \-\-30\-360\ \ \ \ \ \ \ \ \ \ use\ \[aq]30/360\[aq]\ day\ counting\ convention
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \-\-30E\-360\ \ \ \ \ \ \ \ \ use\ \[aq]30E/360\[aq]\ day\ counting\ convention
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \-\-30E\-360isda\ \ \ \ \ use\ \[aq]30E/360isda\[aq]\ day\ counting\ convention
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \-\-constant=RATE\ \ \ constant\ interest\ rate
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \-\-annual=RATE\ \ \ \ \ annual\ interest\ rate
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \-\-bgb288\ \ \ \ \ \ \ \ \ \ compute\ interest\ according\ to\ German\ BGB288
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \-\-ing\-diba\ \ \ \ \ \ \ \ compute\ interest\ according\ for\ Ing\-Diba\ Tagesgeld\ account
|
||||
\f[]
|
||||
.fi
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ cat\ interest.journal
|
||||
2008/09/26\ Loan
|
||||
\ \ \ \ \ Assets:Bank\ \ \ \ \ \ \ \ \ \ EUR\ 10000.00
|
||||
\ \ \ \ \ Liabilities:Bank
|
||||
|
||||
2008/11/27\ Payment
|
||||
\ \ \ \ \ Assets:Bank\ \ \ \ \ \ \ \ \ \ EUR\ \-3771.12
|
||||
\ \ \ \ \ Liabilities:Bank
|
||||
|
||||
2009/05/03\ Payment
|
||||
\ \ \ \ \ Assets:Bank\ \ \ \ \ \ \ \ \ \ EUR\ \-1200.00
|
||||
\ \ \ \ \ Liabilities:Bank
|
||||
|
||||
2010/12/10\ Payment
|
||||
\ \ \ \ \ Assets:Bank\ \ \ \ \ \ \ \ \ \ EUR\ \-3700.00
|
||||
\ \ \ \ \ Liabilities:Bank
|
||||
\f[]
|
||||
.fi
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ hledger\ interest\ \-\-\ \-f\ interest.journal\ \-\-source=Expenses:Interest\ \\
|
||||
\ \ \ \ \-\-target=Liabilities:Bank\ \-\-30\-360\ \-\-annual=0.05\ Liabilities:Bank
|
||||
2008/09/26\ Loan
|
||||
\ \ \ \ Assets:Bank\ \ \ \ \ \ \ EUR\ 10000.00
|
||||
\ \ \ \ Liabilities:Bank\ \ EUR\ \-10000.00
|
||||
|
||||
2008/11/27\ 0.05%\ interest\ for\ EUR\ \-10000.00\ over\ 61\ days
|
||||
\ \ \ \ Liabilities:Bank\ \ \ \ \ EUR\ \-84.72
|
||||
\ \ \ \ Expenses:Interest\ \ \ \ \ EUR\ 84.72
|
||||
|
||||
2008/11/27\ Payment
|
||||
\ \ \ \ Assets:Bank\ \ \ \ \ \ \ EUR\ \-3771.12
|
||||
\ \ \ \ Liabilities:Bank\ \ \ EUR\ 3771.12
|
||||
|
||||
2008/12/31\ 0.05%\ interest\ for\ EUR\ \-6313.60\ over\ 34\ days
|
||||
\ \ \ \ Liabilities:Bank\ \ \ \ \ EUR\ \-29.81
|
||||
\ \ \ \ Expenses:Interest\ \ \ \ \ EUR\ 29.81
|
||||
|
||||
2009/05/03\ 0.05%\ interest\ for\ EUR\ \-6343.42\ over\ 123\ days
|
||||
\ \ \ \ Liabilities:Bank\ \ \ \ EUR\ \-108.37
|
||||
\ \ \ \ Expenses:Interest\ \ \ \ EUR\ 108.37
|
||||
|
||||
2009/05/03\ Payment
|
||||
\ \ \ \ Assets:Bank\ \ \ \ \ \ \ EUR\ \-1200.00
|
||||
\ \ \ \ Liabilities:Bank\ \ \ EUR\ 1200.00
|
||||
|
||||
2009/12/31\ 0.05%\ interest\ for\ EUR\ \-5251.78\ over\ 238\ days
|
||||
\ \ \ \ Liabilities:Bank\ \ \ \ EUR\ \-173.60
|
||||
\ \ \ \ Expenses:Interest\ \ \ \ EUR\ 173.60
|
||||
|
||||
2010/12/10\ 0.05%\ interest\ for\ EUR\ \-5425.38\ over\ 340\ days
|
||||
\ \ \ \ Liabilities:Bank\ \ \ \ EUR\ \-256.20
|
||||
\ \ \ \ Expenses:Interest\ \ \ \ EUR\ 256.20
|
||||
|
||||
2010/12/10\ Payment
|
||||
\ \ \ \ Assets:Bank\ \ \ \ \ \ \ EUR\ \-3700.00
|
||||
\ \ \ \ Liabilities:Bank\ \ \ EUR\ 3700.00
|
||||
\f[]
|
||||
.fi
|
||||
.PP
|
||||
hledger\-interest computes interests for a given account.
|
||||
Using command line flags, the program can be configured to use various
|
||||
schemes for day\-counting, such as act/act, 30/360, 30E/360, and
|
||||
30/360isda.
|
||||
Furthermore, it supports a (small) number of interest schemes, i.e.
|
||||
annual interest with a fixed rate and the scheme mandated by the German
|
||||
BGB288 (Basiszins für Verbrauchergeschäfte).
|
||||
See the package page for more.
|
||||
.SS irr
|
||||
.PP
|
||||
Calculate internal rate of return.
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ hledger\ irr\ \-\-help
|
||||
Usage:\ hledger\-irr\ [OPTION...]
|
||||
\ \ \-h\ \ \ \ \ \ \ \ \ \ \-\-help\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ print\ this\ message\ and\ exit
|
||||
\ \ \-V\ \ \ \ \ \ \ \ \ \ \-\-version\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ show\ version\ number\ and\ exit
|
||||
\ \ \-c\ \ \ \ \ \ \ \ \ \ \-\-cashflow\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ also\ show\ all\ revant\ transactions
|
||||
\ \ \-f\ FILE\ \ \ \ \ \-\-file=FILE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ input\ ledger\ file\ (pass\ \[aq]\-\[aq]\ for\ stdin)
|
||||
\ \ \-i\ ACCOUNT\ \ \-\-investment\-account=ACCOUNT\ \ investment\ account
|
||||
\ \ \-t\ ACCOUNT\ \ \-\-interest\-account=ACCOUNT\ \ \ \ interest/gain/fees/losses\ account
|
||||
\ \ \-b\ DATE\ \ \ \ \ \-\-begin=DATE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ calculate\ interest\ from\ this\ date
|
||||
\ \ \-e\ DATE\ \ \ \ \ \-\-end=DATE\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ calculate\ interest\ until\ this\ date
|
||||
\ \ \-D\ \ \ \ \ \ \ \ \ \ \-\-daily\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ calculate\ interest\ for\ each\ day
|
||||
\ \ \-W\ \ \ \ \ \ \ \ \ \ \-\-weekly\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ calculate\ interest\ for\ each\ week
|
||||
\ \ \-M\ \ \ \ \ \ \ \ \ \ \-\-monthly\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ calculate\ interest\ for\ each\ month
|
||||
\ \ \-Y\ \ \ \ \ \ \ \ \ \ \-\-yearly\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ calculate\ interest\ for\ each\ year
|
||||
\f[]
|
||||
.fi
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ cat\ irr.journal\
|
||||
2011\-01\-01\ Some\ wild\ speculation\ \[en]\ I\ wonder\ if\ it\ pays\ off
|
||||
\ \ \ Speculation\ \ \ €100.00
|
||||
\ \ \ Cash
|
||||
|
||||
2011\-02\-01\ More\ speculation\ (and\ adjustment\ of\ value)
|
||||
\ \ \ Cash\ \ \ \ \ \ \ \ \ \-€10.00
|
||||
\ \ \ Rate\ Gain\ \ \ \ \ \-€1.00
|
||||
\ \ \ Speculation
|
||||
|
||||
2011\-03\-01\ Lets\ pull\ out\ some\ money\ (and\ adjustment\ of\ value)
|
||||
\ \ \ Cash\ \ \ \ \ \ \ \ \ \ €30.00
|
||||
\ \ \ Rate\ Gain\ \ \ \ \ \-€3.00
|
||||
\ \ \ Speculation
|
||||
|
||||
2011\-04\-01\ More\ speculation\ (and\ it\ lost\ some\ money!)
|
||||
\ \ \ Cash\ \ \ \ \ \ \ \ \ \-€50.00
|
||||
\ \ \ Rate\ Gain\ \ \ \ \ €\ 5.00
|
||||
\ \ \ Speculation
|
||||
|
||||
2011\-05\-01\ Getting\ some\ money\ out\ (and\ adjustment\ of\ value)
|
||||
\ \ \ Speculation\ \ \-€44.00
|
||||
\ \ \ Rate\ Gain\ \ \ \ \-€\ 3.00
|
||||
\ \ \ Cash
|
||||
|
||||
2011\-06\-01\ Emptying\ the\ account\ (after\ adjusting\ the\ value)
|
||||
\ \ \ Speculation\ \ \ \-€85.00
|
||||
\ \ \ Cash\ \ \ \ \ \ \ \ \ \ \ €90.00
|
||||
\ \ \ Rate\ Gain\ \ \ \ \ \-€\ 5.00
|
||||
\f[]
|
||||
.fi
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ hledger\-irr\ \-f\ irr.journal\ \-t\ "Rate\ Gain"\ \-i\ Speculation\ \ \-\-monthly
|
||||
2011/01/01\ \-\ 2011/02/01:\ 12.49%
|
||||
2011/02/01\ \-\ 2011/03/01:\ 41.55%
|
||||
2011/03/01\ \-\ 2011/04/01:\ \-51.44%
|
||||
2011/04/01\ \-\ 2011/05/01:\ 32.24%
|
||||
2011/05/01\ \-\ 2011/06/01:\ 95.92%
|
||||
\f[]
|
||||
.fi
|
||||
.PP
|
||||
hledger\-irr computes the internal rate of return, also known as the
|
||||
effective interest rate, of a given investment.
|
||||
After specifying what account holds the investment, and what account
|
||||
stores the gains (or losses, or fees, or cost), it calculates the
|
||||
hypothetical annual rate of fixed rate investment that would have
|
||||
provided the exact same cash flow.
|
||||
See the package page for more.
|
||||
.SS print\-unique
|
||||
.PP
|
||||
Print only only journal entries which have a unique description.
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ cat\ unique.journal
|
||||
1/1\ test
|
||||
\ (acct:one)\ \ 1
|
||||
2/2\ test
|
||||
\ (acct:two)\ \ 2
|
||||
$\ LEDGER_FILE=unique.journal\ hledger\ print\-unique
|
||||
(\-f\ option\ not\ supported)
|
||||
2015/01/01\ test
|
||||
\ \ \ \ (acct:one)\ \ \ \ \ \ \ \ \ \ \ \ \ 1
|
||||
\f[]
|
||||
.fi
|
||||
.SS rewrite
|
||||
.PP
|
||||
Prints all journal entries, adding specified custom postings to matched
|
||||
entries.
|
||||
.PP
|
||||
hledger\-rewrite.hs, in hledger\[aq]s extra directory (compilation
|
||||
optional), adds postings to existing transactions, optionally with an
|
||||
amount based on the existing transaction\[aq]s first amount.
|
||||
See the script for more details.
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
$\ hledger\ rewrite\ \-\-\ [QUERY]\ \ \ \ \ \ \ \ \-\-add\-posting\ "ACCT\ \ AMTEXPR"\ ...
|
||||
$\ hledger\ rewrite\ \-\-\ ^income\ \ \ \ \ \ \ \ \-\-add\-posting\ \[aq](liabilities:tax)\ \ *.33\[aq]
|
||||
$\ hledger\ rewrite\ \-\-\ expenses:gifts\ \-\-add\-posting\ \[aq](budget:gifts)\ \ *\-1"\[aq]
|
||||
\f[]
|
||||
.fi
|
||||
.SS ui
|
||||
.PP
|
||||
Curses\-style interface, see hledger\-ui.
|
||||
.SS web
|
||||
.PP
|
||||
Web interface, see hledger\-web.
|
||||
.SS Third party add\-ons
|
||||
.PP
|
||||
These are maintained separately from hledger, and usually updated
|
||||
shortly after a hledger release.
|
||||
.SS diff
|
||||
.PP
|
||||
hledger\-diff Shows differences in an account\[aq]s transactions between
|
||||
one journal file and another.
|
||||
.SS iadd
|
||||
.PP
|
||||
hledger\-iadd A curses\-style, more interactive replacement for the add
|
||||
command.
|
||||
.SS interest
|
||||
.PP
|
||||
hledger\-interest Generates interest transactions for an account
|
||||
according to various schemes.
|
||||
.SS irr
|
||||
.PP
|
||||
hledger\-irr Calculates the internal rate of return of an investment
|
||||
account.
|
||||
.SS Experimental add\-ons
|
||||
.PP
|
||||
These add\-ons are available in source form in the hledger repo.
|
||||
Installing them is pretty easy.
|
||||
Reading and copying these is a good way to start making your own
|
||||
add\-ons.
|
||||
.SS budget
|
||||
.PP
|
||||
hledger\-budget.hs A tool adding more budget\-tracking features to
|
||||
hledger.
|
||||
.SS chart
|
||||
.PP
|
||||
hledger\-chart.hs An old pie chart generator, in need of some love.
|
||||
.SS check\-dates
|
||||
.PP
|
||||
hledger\-check\-dates.hs Checks that journal entries are ordered by
|
||||
date.
|
||||
.SS dupes
|
||||
.PP
|
||||
hledger\-dupes.hs Checks for account names sharing the same leaf name.
|
||||
.SS equity
|
||||
.PP
|
||||
hledger\-equity.hs Prints balance\-resetting transactions useful for
|
||||
bringing account balances across file boundaries.
|
||||
.SS print\-unique
|
||||
.PP
|
||||
hledger\-print\-unique.hs Prints transactions which do not reuse an
|
||||
already\-seen description.
|
||||
.SS register\-match
|
||||
.PP
|
||||
hledger\-register\-match.hs Helps ledger\-autosync recognise
|
||||
already\-imported transactions.
|
||||
.SS rewrite
|
||||
.PP
|
||||
hledger\-rewrite.hs Adds one or more custom postings to matched
|
||||
transactions.
|
||||
.SH TROUBLESHOOTING
|
||||
.SS Run\-time problems
|
||||
.PP
|
||||
|
@ -1843,381 +1843,190 @@ directory in the hledger source, or elsewhere:
|
||||
|
||||
* Menu:
|
||||
|
||||
* Official add-ons::
|
||||
* Third party add-ons::
|
||||
* Experimental add-ons::
|
||||
|
||||
|
||||
File: hledger.1.info, Node: Official add-ons, Next: Third party add-ons, Up: ADD-ON COMMANDS
|
||||
|
||||
5.1 Official add-ons
|
||||
====================
|
||||
|
||||
These are maintained and released along with hledger.
|
||||
|
||||
* Menu:
|
||||
|
||||
* api::
|
||||
* autosync::
|
||||
* diff::
|
||||
* equity::
|
||||
* interest::
|
||||
* irr::
|
||||
* print-unique::
|
||||
* rewrite::
|
||||
* ui::
|
||||
* web::
|
||||
|
||||
|
||||
File: hledger.1.info, Node: api, Next: autosync, Up: ADD-ON COMMANDS
|
||||
File: hledger.1.info, Node: api, Next: ui, Up: Official add-ons
|
||||
|
||||
5.1 api
|
||||
=======
|
||||
5.1.1 api
|
||||
---------
|
||||
|
||||
Web API server, see hledger-api.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: autosync, Next: diff, Prev: api, Up: ADD-ON COMMANDS
|
||||
File: hledger.1.info, Node: ui, Next: web, Prev: api, Up: Official add-ons
|
||||
|
||||
5.2 autosync
|
||||
============
|
||||
|
||||
Download OFX bank data and/or convert OFX to hledger journal format.
|
||||
|
||||
|
||||
$ hledger autosync --help
|
||||
usage: hledger-autosync [-h] [-m MAX] [-r] [-a ACCOUNT] [-l LEDGER] [-i INDENT]
|
||||
[--initial] [--fid FID] [--assertions] [-d] [--hledger]
|
||||
[--slow] [--which]
|
||||
[PATH]
|
||||
|
||||
Synchronize ledger.
|
||||
|
||||
positional arguments:
|
||||
PATH do not sync; import from OFX file
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-m MAX, --max MAX maximum number of days to process
|
||||
-r, --resync do not stop until max days reached
|
||||
-a ACCOUNT, --account ACCOUNT
|
||||
set account name for import
|
||||
-l LEDGER, --ledger LEDGER
|
||||
specify ledger file to READ for syncing
|
||||
-i INDENT, --indent INDENT
|
||||
number of spaces to use for indentation
|
||||
--initial create initial balance entries
|
||||
--fid FID pass in fid value for OFX files that do not supply it
|
||||
--assertions create balance assertion entries
|
||||
-d, --debug enable debug logging
|
||||
--hledger force use of hledger (on by default if invoked as hledger-
|
||||
autosync)
|
||||
--slow use slow, but possibly more robust, method of calling ledger
|
||||
(no subprocess)
|
||||
--which display which version of ledger/hledger/ledger-python will
|
||||
be used by ledger-autosync to check for previous
|
||||
transactions
|
||||
$ head acct1.ofx
|
||||
OFXHEADER:100
|
||||
DATA:OFXSGML
|
||||
VERSION:102
|
||||
SECURITY:NONE
|
||||
ENCODING:USASCII
|
||||
CHARSET:1252
|
||||
COMPRESSION:NONE
|
||||
OLDFILEUID:NONE
|
||||
NEWFILEUIDe:8509488b59d1bb45
|
||||
|
||||
$ hledger autosync acct1.ofx
|
||||
2013/08/30 MONTHLY SERVICE FEE
|
||||
; ofxid: 3000.4303001832.201308301
|
||||
WF:4303001832 -$6.00
|
||||
[assets:business:bank:wf:bchecking:banking] $6.00
|
||||
|
||||
ledger-autosync, which includes a `hledger-autosync' alias,
|
||||
downloads transactions from your bank(s) via OFX, and prints just the
|
||||
new ones as journal entries which you can add to your journal. It can
|
||||
also operate on .OFX files which you've downloaded manually. It can be a
|
||||
nice alternative to hledger's built-in CSV reader, especially if your
|
||||
bank supports OFX download.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: diff, Next: equity, Prev: autosync, Up: ADD-ON COMMANDS
|
||||
|
||||
5.3 diff
|
||||
========
|
||||
|
||||
Show transactions present in one journal file but not another
|
||||
|
||||
|
||||
$ hledger diff --help
|
||||
Usage: hledger-diff account:name left.journal right.journal
|
||||
$ cat a.journal
|
||||
1/1
|
||||
(acct:one) 1
|
||||
|
||||
$ cat b.journal
|
||||
1/1
|
||||
(acct:one) 1
|
||||
2/2
|
||||
(acct:two) 2
|
||||
|
||||
$ hledger diff acct:two a.journal b.journal
|
||||
Unmatched transactions in the first journal:
|
||||
|
||||
Unmatched transactions in the second journal:
|
||||
|
||||
2015/02/02
|
||||
(acct:two) $2
|
||||
|
||||
hledger-diff compares two journal files. Given an account name, it
|
||||
prints out the transactions affecting that account which are in one
|
||||
journal file but not in the other. This can be useful for reconciling
|
||||
existing journals with bank statements.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: equity, Next: interest, Prev: diff, Up: ADD-ON COMMANDS
|
||||
|
||||
5.4 equity
|
||||
==========
|
||||
|
||||
Print a journal entry that resets account balances to zero.
|
||||
|
||||
|
||||
$ hledger balance --flat -E assets liabilities
|
||||
0 assets:bank:checking
|
||||
$1 assets:bank:saving
|
||||
$-2 assets:cash
|
||||
$1 liabilities:debts
|
||||
--------------------
|
||||
0
|
||||
$ hledger equity assets liabilities
|
||||
2015/05/23
|
||||
assets:bank:saving $-1
|
||||
assets:cash $2
|
||||
liabilities:debts $-1
|
||||
equity:closing balances 0
|
||||
|
||||
2015/05/23
|
||||
assets:bank:saving $1
|
||||
assets:cash $-2
|
||||
liabilities:debts $1
|
||||
equity:opening balances 0
|
||||
|
||||
This prints a journal entry which zeroes out the specified accounts
|
||||
(or all accounts) with a transfer to/from "equity:closing balances"
|
||||
(like Ledger's equity command). Also, it prints an similar entry with
|
||||
opposite sign for restoring the balances from "equity:opening balances".
|
||||
|
||||
These can be useful for ending one journal file and starting a new
|
||||
one, respectively. By zeroing your asset and liability accounts at the
|
||||
end of a file and restoring them at the start of the next one, you will
|
||||
see correct asset/liability balances whether you run hledger on just one
|
||||
file, or on several files concatenated with include.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: interest, Next: irr, Prev: equity, Up: ADD-ON COMMANDS
|
||||
|
||||
5.5 interest
|
||||
============
|
||||
|
||||
Generate interest transactions.
|
||||
|
||||
|
||||
$ hledger interest --help
|
||||
Usage: hledger-interest [OPTION...] ACCOUNT
|
||||
-h --help print this message and exit
|
||||
-V --version show version number and exit
|
||||
-v --verbose echo input ledger to stdout (default)
|
||||
-q --quiet don't echo input ledger to stdout
|
||||
--today compute interest up until today
|
||||
-f FILE --file=FILE input ledger file (pass '-' for stdin)
|
||||
-s ACCOUNT --source=ACCOUNT interest source account
|
||||
-t ACCOUNT --target=ACCOUNT interest target account
|
||||
--act use 'act' day counting convention
|
||||
--30-360 use '30/360' day counting convention
|
||||
--30E-360 use '30E/360' day counting convention
|
||||
--30E-360isda use '30E/360isda' day counting convention
|
||||
--constant=RATE constant interest rate
|
||||
--annual=RATE annual interest rate
|
||||
--bgb288 compute interest according to German BGB288
|
||||
--ing-diba compute interest according for Ing-Diba Tagesgeld account
|
||||
|
||||
|
||||
$ cat interest.journal
|
||||
2008/09/26 Loan
|
||||
Assets:Bank EUR 10000.00
|
||||
Liabilities:Bank
|
||||
|
||||
2008/11/27 Payment
|
||||
Assets:Bank EUR -3771.12
|
||||
Liabilities:Bank
|
||||
|
||||
2009/05/03 Payment
|
||||
Assets:Bank EUR -1200.00
|
||||
Liabilities:Bank
|
||||
|
||||
2010/12/10 Payment
|
||||
Assets:Bank EUR -3700.00
|
||||
Liabilities:Bank
|
||||
|
||||
|
||||
$ hledger interest -- -f interest.journal --source=Expenses:Interest \
|
||||
--target=Liabilities:Bank --30-360 --annual=0.05 Liabilities:Bank
|
||||
2008/09/26 Loan
|
||||
Assets:Bank EUR 10000.00
|
||||
Liabilities:Bank EUR -10000.00
|
||||
|
||||
2008/11/27 0.05% interest for EUR -10000.00 over 61 days
|
||||
Liabilities:Bank EUR -84.72
|
||||
Expenses:Interest EUR 84.72
|
||||
|
||||
2008/11/27 Payment
|
||||
Assets:Bank EUR -3771.12
|
||||
Liabilities:Bank EUR 3771.12
|
||||
|
||||
2008/12/31 0.05% interest for EUR -6313.60 over 34 days
|
||||
Liabilities:Bank EUR -29.81
|
||||
Expenses:Interest EUR 29.81
|
||||
|
||||
2009/05/03 0.05% interest for EUR -6343.42 over 123 days
|
||||
Liabilities:Bank EUR -108.37
|
||||
Expenses:Interest EUR 108.37
|
||||
|
||||
2009/05/03 Payment
|
||||
Assets:Bank EUR -1200.00
|
||||
Liabilities:Bank EUR 1200.00
|
||||
|
||||
2009/12/31 0.05% interest for EUR -5251.78 over 238 days
|
||||
Liabilities:Bank EUR -173.60
|
||||
Expenses:Interest EUR 173.60
|
||||
|
||||
2010/12/10 0.05% interest for EUR -5425.38 over 340 days
|
||||
Liabilities:Bank EUR -256.20
|
||||
Expenses:Interest EUR 256.20
|
||||
|
||||
2010/12/10 Payment
|
||||
Assets:Bank EUR -3700.00
|
||||
Liabilities:Bank EUR 3700.00
|
||||
|
||||
hledger-interest computes interests for a given account. Using
|
||||
command line flags, the program can be configured to use various
|
||||
schemes for day-counting, such as act/act, 30/360, 30E/360, and
|
||||
30/360isda. Furthermore, it supports a (small) number of interest
|
||||
schemes, i.e. annual interest with a fixed rate and the scheme
|
||||
mandated by the German BGB288 (Basiszins für Verbrauchergeschäfte).
|
||||
See the package page for more.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: irr, Next: print-unique, Prev: interest, Up: ADD-ON COMMANDS
|
||||
|
||||
5.6 irr
|
||||
=======
|
||||
|
||||
Calculate internal rate of return.
|
||||
|
||||
|
||||
$ hledger irr --help
|
||||
Usage: hledger-irr [OPTION...]
|
||||
-h --help print this message and exit
|
||||
-V --version show version number and exit
|
||||
-c --cashflow also show all revant transactions
|
||||
-f FILE --file=FILE input ledger file (pass '-' for stdin)
|
||||
-i ACCOUNT --investment-account=ACCOUNT investment account
|
||||
-t ACCOUNT --interest-account=ACCOUNT interest/gain/fees/losses account
|
||||
-b DATE --begin=DATE calculate interest from this date
|
||||
-e DATE --end=DATE calculate interest until this date
|
||||
-D --daily calculate interest for each day
|
||||
-W --weekly calculate interest for each week
|
||||
-M --monthly calculate interest for each month
|
||||
-Y --yearly calculate interest for each year
|
||||
|
||||
|
||||
$ cat irr.journal
|
||||
2011-01-01 Some wild speculation – I wonder if it pays off
|
||||
Speculation €100.00
|
||||
Cash
|
||||
|
||||
2011-02-01 More speculation (and adjustment of value)
|
||||
Cash -€10.00
|
||||
Rate Gain -€1.00
|
||||
Speculation
|
||||
|
||||
2011-03-01 Lets pull out some money (and adjustment of value)
|
||||
Cash €30.00
|
||||
Rate Gain -€3.00
|
||||
Speculation
|
||||
|
||||
2011-04-01 More speculation (and it lost some money!)
|
||||
Cash -€50.00
|
||||
Rate Gain € 5.00
|
||||
Speculation
|
||||
|
||||
2011-05-01 Getting some money out (and adjustment of value)
|
||||
Speculation -€44.00
|
||||
Rate Gain -€ 3.00
|
||||
Cash
|
||||
|
||||
2011-06-01 Emptying the account (after adjusting the value)
|
||||
Speculation -€85.00
|
||||
Cash €90.00
|
||||
Rate Gain -€ 5.00
|
||||
|
||||
|
||||
$ hledger-irr -f irr.journal -t "Rate Gain" -i Speculation --monthly
|
||||
2011/01/01 - 2011/02/01: 12.49%
|
||||
2011/02/01 - 2011/03/01: 41.55%
|
||||
2011/03/01 - 2011/04/01: -51.44%
|
||||
2011/04/01 - 2011/05/01: 32.24%
|
||||
2011/05/01 - 2011/06/01: 95.92%
|
||||
|
||||
hledger-irr computes the internal rate of return, also known as the
|
||||
effective interest rate, of a given investment. After specifying what
|
||||
account holds the investment, and what account stores the gains (or
|
||||
losses, or fees, or cost), it calculates the hypothetical annual rate of
|
||||
fixed rate investment that would have provided the exact same cash flow.
|
||||
See the package page for more.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: print-unique, Next: rewrite, Prev: irr, Up: ADD-ON COMMANDS
|
||||
|
||||
5.7 print-unique
|
||||
================
|
||||
|
||||
Print only only journal entries which have a unique description.
|
||||
|
||||
|
||||
$ cat unique.journal
|
||||
1/1 test
|
||||
(acct:one) 1
|
||||
2/2 test
|
||||
(acct:two) 2
|
||||
$ LEDGER_FILE=unique.journal hledger print-unique
|
||||
(-f option not supported)
|
||||
2015/01/01 test
|
||||
(acct:one) 1
|
||||
|
||||
|
||||
File: hledger.1.info, Node: rewrite, Next: ui, Prev: print-unique, Up: ADD-ON COMMANDS
|
||||
|
||||
5.8 rewrite
|
||||
===========
|
||||
|
||||
Prints all journal entries, adding specified custom postings to matched
|
||||
entries.
|
||||
|
||||
hledger-rewrite.hs, in hledger's extra directory (compilation
|
||||
optional), adds postings to existing transactions, optionally with an
|
||||
amount based on the existing transaction's first amount. See the script
|
||||
for more details.
|
||||
|
||||
|
||||
$ hledger rewrite -- [QUERY] --add-posting "ACCT AMTEXPR" ...
|
||||
$ hledger rewrite -- ^income --add-posting '(liabilities:tax) *.33'
|
||||
$ hledger rewrite -- expenses:gifts --add-posting '(budget:gifts) *-1"'
|
||||
|
||||
|
||||
File: hledger.1.info, Node: ui, Next: web, Prev: rewrite, Up: ADD-ON COMMANDS
|
||||
|
||||
5.9 ui
|
||||
======
|
||||
5.1.2 ui
|
||||
--------
|
||||
|
||||
Curses-style interface, see hledger-ui.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: web, Prev: ui, Up: ADD-ON COMMANDS
|
||||
File: hledger.1.info, Node: web, Prev: ui, Up: Official add-ons
|
||||
|
||||
5.10 web
|
||||
========
|
||||
5.1.3 web
|
||||
---------
|
||||
|
||||
Web interface, see hledger-web.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: Third party add-ons, Next: Experimental add-ons, Prev: Official add-ons, Up: ADD-ON COMMANDS
|
||||
|
||||
5.2 Third party add-ons
|
||||
=======================
|
||||
|
||||
These are maintained separately from hledger, and usually updated
|
||||
shortly after a hledger release.
|
||||
|
||||
* Menu:
|
||||
|
||||
* diff::
|
||||
* iadd::
|
||||
* interest::
|
||||
* irr::
|
||||
|
||||
|
||||
File: hledger.1.info, Node: diff, Next: iadd, Up: Third party add-ons
|
||||
|
||||
5.2.1 diff
|
||||
----------
|
||||
|
||||
hledger-diff Shows differences in an account's transactions between one
|
||||
journal file and another.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: iadd, Next: interest, Prev: diff, Up: Third party add-ons
|
||||
|
||||
5.2.2 iadd
|
||||
----------
|
||||
|
||||
hledger-iadd A curses-style, more interactive replacement for the add
|
||||
command.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: interest, Next: irr, Prev: iadd, Up: Third party add-ons
|
||||
|
||||
5.2.3 interest
|
||||
--------------
|
||||
|
||||
hledger-interest Generates interest transactions for an account
|
||||
according to various schemes.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: irr, Prev: interest, Up: Third party add-ons
|
||||
|
||||
5.2.4 irr
|
||||
---------
|
||||
|
||||
hledger-irr Calculates the internal rate of return of an investment
|
||||
account.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: Experimental add-ons, Prev: Third party add-ons, Up: ADD-ON COMMANDS
|
||||
|
||||
5.3 Experimental add-ons
|
||||
========================
|
||||
|
||||
These add-ons are available in source form in the hledger repo.
|
||||
Installing them is pretty easy. Reading and copying these is a good way
|
||||
to start making your own add-ons.
|
||||
|
||||
* Menu:
|
||||
|
||||
* budget::
|
||||
* chart::
|
||||
* check-dates::
|
||||
* dupes::
|
||||
* equity::
|
||||
* print-unique::
|
||||
* register-match::
|
||||
* rewrite::
|
||||
|
||||
|
||||
File: hledger.1.info, Node: budget, Next: chart, Up: Experimental add-ons
|
||||
|
||||
5.3.1 budget
|
||||
------------
|
||||
|
||||
hledger-budget.hs A tool adding more budget-tracking features to
|
||||
hledger.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: chart, Next: check-dates, Prev: budget, Up: Experimental add-ons
|
||||
|
||||
5.3.2 chart
|
||||
-----------
|
||||
|
||||
hledger-chart.hs An old pie chart generator, in need of some love.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: check-dates, Next: dupes, Prev: chart, Up: Experimental add-ons
|
||||
|
||||
5.3.3 check-dates
|
||||
-----------------
|
||||
|
||||
hledger-check-dates.hs Checks that journal entries are ordered by date.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: dupes, Next: equity, Prev: check-dates, Up: Experimental add-ons
|
||||
|
||||
5.3.4 dupes
|
||||
-----------
|
||||
|
||||
hledger-dupes.hs Checks for account names sharing the same leaf name.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: equity, Next: print-unique, Prev: dupes, Up: Experimental add-ons
|
||||
|
||||
5.3.5 equity
|
||||
------------
|
||||
|
||||
hledger-equity.hs Prints balance-resetting transactions useful for
|
||||
bringing account balances across file boundaries.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: print-unique, Next: register-match, Prev: equity, Up: Experimental add-ons
|
||||
|
||||
5.3.6 print-unique
|
||||
------------------
|
||||
|
||||
hledger-print-unique.hs Prints transactions which do not reuse an
|
||||
already-seen description.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: register-match, Next: rewrite, Prev: print-unique, Up: Experimental add-ons
|
||||
|
||||
5.3.7 register-match
|
||||
--------------------
|
||||
|
||||
hledger-register-match.hs Helps ledger-autosync recognise
|
||||
already-imported transactions.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: rewrite, Prev: register-match, Up: Experimental add-ons
|
||||
|
||||
5.3.8 rewrite
|
||||
-------------
|
||||
|
||||
hledger-rewrite.hs Adds one or more custom postings to matched
|
||||
transactions.
|
||||
|
||||
|
||||
File: hledger.1.info, Node: TROUBLESHOOTING, Prev: ADD-ON COMMANDS, Up: Top
|
||||
|
||||
@ -2401,31 +2210,47 @@ Node: test58331
|
||||
Ref: #test58418
|
||||
Node: ADD-ON COMMANDS58785
|
||||
Ref: #add-on-commands58921
|
||||
Node: api60209
|
||||
Ref: #api60301
|
||||
Node: autosync60335
|
||||
Ref: #autosync60450
|
||||
Node: diff62765
|
||||
Ref: #diff62875
|
||||
Node: equity63539
|
||||
Ref: #equity63653
|
||||
Node: interest64981
|
||||
Ref: #interest65098
|
||||
Node: irr68182
|
||||
Ref: #irr68295
|
||||
Node: print-unique70670
|
||||
Ref: #print-unique70800
|
||||
Node: rewrite71058
|
||||
Ref: #rewrite71177
|
||||
Node: ui71706
|
||||
Ref: #ui71806
|
||||
Node: web71847
|
||||
Ref: #web71935
|
||||
Node: TROUBLESHOOTING71968
|
||||
Ref: #troubleshooting72087
|
||||
Node: Run-time problems72141
|
||||
Ref: #run-time-problems72284
|
||||
Node: Known limitations74228
|
||||
Ref: #known-limitations74371
|
||||
Node: Official add-ons60173
|
||||
Ref: #official-add-ons60315
|
||||
Node: api60403
|
||||
Ref: #api60494
|
||||
Node: ui60528
|
||||
Ref: #ui60629
|
||||
Node: web60670
|
||||
Ref: #web60761
|
||||
Node: Third party add-ons60794
|
||||
Ref: #third-party-add-ons60971
|
||||
Node: diff61120
|
||||
Ref: #diff61219
|
||||
Node: iadd61318
|
||||
Ref: #iadd61434
|
||||
Node: interest61514
|
||||
Ref: #interest61637
|
||||
Node: irr61732
|
||||
Ref: #irr61832
|
||||
Node: Experimental add-ons61910
|
||||
Ref: #experimental-add-ons62064
|
||||
Node: budget62351
|
||||
Ref: #budget62458
|
||||
Node: chart62533
|
||||
Ref: #chart62658
|
||||
Node: check-dates62726
|
||||
Ref: #check-dates62862
|
||||
Node: dupes62935
|
||||
Ref: #dupes63060
|
||||
Node: equity63131
|
||||
Ref: #equity63259
|
||||
Node: print-unique63377
|
||||
Ref: #print-unique63526
|
||||
Node: register-match63619
|
||||
Ref: #register-match63773
|
||||
Node: rewrite63863
|
||||
Ref: #rewrite63982
|
||||
Node: TROUBLESHOOTING64060
|
||||
Ref: #troubleshooting64179
|
||||
Node: Run-time problems64233
|
||||
Ref: #run-time-problems64376
|
||||
Node: Known limitations66320
|
||||
Ref: #known-limitations66463
|
||||
|
||||
End Tag Table
|
||||
|
@ -1566,331 +1566,94 @@ ADD-ON COMMANDS
|
||||
Here are some hledger add-ons available from Hackage, the extra direc-
|
||||
tory in the hledger source, or elsewhere:
|
||||
|
||||
Official add-ons
|
||||
These are maintained and released along with hledger.
|
||||
|
||||
api
|
||||
Web API server, see hledger-api.
|
||||
|
||||
autosync
|
||||
Download OFX bank data and/or convert OFX to hledger journal format.
|
||||
|
||||
$ hledger autosync --help
|
||||
usage: hledger-autosync [-h] [-m MAX] [-r] [-a ACCOUNT] [-l LEDGER] [-i INDENT]
|
||||
[--initial] [--fid FID] [--assertions] [-d] [--hledger]
|
||||
[--slow] [--which]
|
||||
[PATH]
|
||||
|
||||
Synchronize ledger.
|
||||
|
||||
positional arguments:
|
||||
PATH do not sync; import from OFX file
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-m MAX, --max MAX maximum number of days to process
|
||||
-r, --resync do not stop until max days reached
|
||||
-a ACCOUNT, --account ACCOUNT
|
||||
set account name for import
|
||||
-l LEDGER, --ledger LEDGER
|
||||
specify ledger file to READ for syncing
|
||||
-i INDENT, --indent INDENT
|
||||
number of spaces to use for indentation
|
||||
--initial create initial balance entries
|
||||
--fid FID pass in fid value for OFX files that do not supply it
|
||||
--assertions create balance assertion entries
|
||||
-d, --debug enable debug logging
|
||||
--hledger force use of hledger (on by default if invoked as hledger-
|
||||
autosync)
|
||||
--slow use slow, but possibly more robust, method of calling ledger
|
||||
(no subprocess)
|
||||
--which display which version of ledger/hledger/ledger-python will
|
||||
be used by ledger-autosync to check for previous
|
||||
transactions
|
||||
$ head acct1.ofx
|
||||
OFXHEADER:100
|
||||
DATA:OFXSGML
|
||||
VERSION:102
|
||||
SECURITY:NONE
|
||||
ENCODING:USASCII
|
||||
CHARSET:1252
|
||||
COMPRESSION:NONE
|
||||
OLDFILEUID:NONE
|
||||
NEWFILEUIDe:8509488b59d1bb45
|
||||
|
||||
$ hledger autosync acct1.ofx
|
||||
2013/08/30 MONTHLY SERVICE FEE
|
||||
; ofxid: 3000.4303001832.201308301
|
||||
WF:4303001832 -$6.00
|
||||
[assets:business:bank:wf:bchecking:banking] $6.00
|
||||
|
||||
ledger-autosync, which includes a hledger-autosync alias, downloads
|
||||
transactions from your bank(s) via OFX, and prints just the new ones as
|
||||
journal entries which you can add to your journal. It can also operate
|
||||
on .OFX files which you've downloaded manually. It can be a nice
|
||||
alternative to hledger's built-in CSV reader, especially if your bank
|
||||
supports OFX download.
|
||||
|
||||
diff
|
||||
Show transactions present in one journal file but not another
|
||||
|
||||
$ hledger diff --help
|
||||
Usage: hledger-diff account:name left.journal right.journal
|
||||
$ cat a.journal
|
||||
1/1
|
||||
(acct:one) 1
|
||||
|
||||
$ cat b.journal
|
||||
1/1
|
||||
(acct:one) 1
|
||||
2/2
|
||||
(acct:two) 2
|
||||
|
||||
$ hledger diff acct:two a.journal b.journal
|
||||
Unmatched transactions in the first journal:
|
||||
|
||||
Unmatched transactions in the second journal:
|
||||
|
||||
2015/02/02
|
||||
(acct:two) $2
|
||||
|
||||
hledger-diff compares two journal files. Given an account name, it
|
||||
prints out the transactions affecting that account which are in one
|
||||
journal file but not in the other. This can be useful for reconciling
|
||||
existing journals with bank statements.
|
||||
|
||||
equity
|
||||
Print a journal entry that resets account balances to zero.
|
||||
|
||||
$ hledger balance --flat -E assets liabilities
|
||||
0 assets:bank:checking
|
||||
$1 assets:bank:saving
|
||||
$-2 assets:cash
|
||||
$1 liabilities:debts
|
||||
--------------------
|
||||
0
|
||||
$ hledger equity assets liabilities
|
||||
2015/05/23
|
||||
assets:bank:saving $-1
|
||||
assets:cash $2
|
||||
liabilities:debts $-1
|
||||
equity:closing balances 0
|
||||
|
||||
2015/05/23
|
||||
assets:bank:saving $1
|
||||
assets:cash $-2
|
||||
liabilities:debts $1
|
||||
equity:opening balances 0
|
||||
|
||||
This prints a journal entry which zeroes out the specified accounts (or
|
||||
all accounts) with a transfer to/from "equity:closing balances" (like
|
||||
Ledger's equity command). Also, it prints an similar entry with oppo-
|
||||
site sign for restoring the balances from "equity:opening balances".
|
||||
|
||||
These can be useful for ending one journal file and starting a new one,
|
||||
respectively. By zeroing your asset and liability accounts at the end
|
||||
of a file and restoring them at the start of the next one, you will see
|
||||
correct asset/liability balances whether you run hledger on just one
|
||||
file, or on several files concatenated with include.
|
||||
|
||||
interest
|
||||
Generate interest transactions.
|
||||
|
||||
$ hledger interest --help
|
||||
Usage: hledger-interest [OPTION...] ACCOUNT
|
||||
-h --help print this message and exit
|
||||
-V --version show version number and exit
|
||||
-v --verbose echo input ledger to stdout (default)
|
||||
-q --quiet don't echo input ledger to stdout
|
||||
--today compute interest up until today
|
||||
-f FILE --file=FILE input ledger file (pass '-' for stdin)
|
||||
-s ACCOUNT --source=ACCOUNT interest source account
|
||||
-t ACCOUNT --target=ACCOUNT interest target account
|
||||
--act use 'act' day counting convention
|
||||
--30-360 use '30/360' day counting convention
|
||||
--30E-360 use '30E/360' day counting convention
|
||||
--30E-360isda use '30E/360isda' day counting convention
|
||||
--constant=RATE constant interest rate
|
||||
--annual=RATE annual interest rate
|
||||
--bgb288 compute interest according to German BGB288
|
||||
--ing-diba compute interest according for Ing-Diba Tagesgeld account
|
||||
|
||||
$ cat interest.journal
|
||||
2008/09/26 Loan
|
||||
Assets:Bank EUR 10000.00
|
||||
Liabilities:Bank
|
||||
|
||||
2008/11/27 Payment
|
||||
Assets:Bank EUR -3771.12
|
||||
Liabilities:Bank
|
||||
|
||||
2009/05/03 Payment
|
||||
Assets:Bank EUR -1200.00
|
||||
Liabilities:Bank
|
||||
|
||||
2010/12/10 Payment
|
||||
Assets:Bank EUR -3700.00
|
||||
Liabilities:Bank
|
||||
|
||||
$ hledger interest -- -f interest.journal --source=Expenses:Interest \
|
||||
--target=Liabilities:Bank --30-360 --annual=0.05 Liabilities:Bank
|
||||
2008/09/26 Loan
|
||||
Assets:Bank EUR 10000.00
|
||||
Liabilities:Bank EUR -10000.00
|
||||
|
||||
2008/11/27 0.05% interest for EUR -10000.00 over 61 days
|
||||
Liabilities:Bank EUR -84.72
|
||||
Expenses:Interest EUR 84.72
|
||||
|
||||
2008/11/27 Payment
|
||||
Assets:Bank EUR -3771.12
|
||||
Liabilities:Bank EUR 3771.12
|
||||
|
||||
2008/12/31 0.05% interest for EUR -6313.60 over 34 days
|
||||
Liabilities:Bank EUR -29.81
|
||||
Expenses:Interest EUR 29.81
|
||||
|
||||
2009/05/03 0.05% interest for EUR -6343.42 over 123 days
|
||||
Liabilities:Bank EUR -108.37
|
||||
Expenses:Interest EUR 108.37
|
||||
|
||||
2009/05/03 Payment
|
||||
Assets:Bank EUR -1200.00
|
||||
Liabilities:Bank EUR 1200.00
|
||||
|
||||
2009/12/31 0.05% interest for EUR -5251.78 over 238 days
|
||||
Liabilities:Bank EUR -173.60
|
||||
Expenses:Interest EUR 173.60
|
||||
|
||||
2010/12/10 0.05% interest for EUR -5425.38 over 340 days
|
||||
Liabilities:Bank EUR -256.20
|
||||
Expenses:Interest EUR 256.20
|
||||
|
||||
2010/12/10 Payment
|
||||
Assets:Bank EUR -3700.00
|
||||
Liabilities:Bank EUR 3700.00
|
||||
|
||||
hledger-interest computes interests for a given account. Using command
|
||||
line flags, the program can be configured to use various schemes for
|
||||
day-counting, such as act/act, 30/360, 30E/360, and 30/360isda. Fur-
|
||||
thermore, it supports a (small) number of interest schemes, i.e.
|
||||
annual interest with a fixed rate and the scheme mandated by the German
|
||||
BGB288 (Basiszins fr Verbrauchergeschfte). See the package page for
|
||||
more.
|
||||
|
||||
irr
|
||||
Calculate internal rate of return.
|
||||
|
||||
$ hledger irr --help
|
||||
Usage: hledger-irr [OPTION...]
|
||||
-h --help print this message and exit
|
||||
-V --version show version number and exit
|
||||
-c --cashflow also show all revant transactions
|
||||
-f FILE --file=FILE input ledger file (pass '-' for stdin)
|
||||
-i ACCOUNT --investment-account=ACCOUNT investment account
|
||||
-t ACCOUNT --interest-account=ACCOUNT interest/gain/fees/losses account
|
||||
-b DATE --begin=DATE calculate interest from this date
|
||||
-e DATE --end=DATE calculate interest until this date
|
||||
-D --daily calculate interest for each day
|
||||
-W --weekly calculate interest for each week
|
||||
-M --monthly calculate interest for each month
|
||||
-Y --yearly calculate interest for each year
|
||||
|
||||
$ cat irr.journal
|
||||
2011-01-01 Some wild speculation - I wonder if it pays off
|
||||
Speculation 100.00
|
||||
Cash
|
||||
|
||||
2011-02-01 More speculation (and adjustment of value)
|
||||
Cash -10.00
|
||||
Rate Gain -1.00
|
||||
Speculation
|
||||
|
||||
2011-03-01 Lets pull out some money (and adjustment of value)
|
||||
Cash 30.00
|
||||
Rate Gain -3.00
|
||||
Speculation
|
||||
|
||||
2011-04-01 More speculation (and it lost some money!)
|
||||
Cash -50.00
|
||||
Rate Gain 5.00
|
||||
Speculation
|
||||
|
||||
2011-05-01 Getting some money out (and adjustment of value)
|
||||
Speculation -44.00
|
||||
Rate Gain - 3.00
|
||||
Cash
|
||||
|
||||
2011-06-01 Emptying the account (after adjusting the value)
|
||||
Speculation -85.00
|
||||
Cash 90.00
|
||||
Rate Gain - 5.00
|
||||
|
||||
$ hledger-irr -f irr.journal -t "Rate Gain" -i Speculation --monthly
|
||||
2011/01/01 - 2011/02/01: 12.49%
|
||||
2011/02/01 - 2011/03/01: 41.55%
|
||||
2011/03/01 - 2011/04/01: -51.44%
|
||||
2011/04/01 - 2011/05/01: 32.24%
|
||||
2011/05/01 - 2011/06/01: 95.92%
|
||||
|
||||
hledger-irr computes the internal rate of return, also known as the
|
||||
effective interest rate, of a given investment. After specifying what
|
||||
account holds the investment, and what account stores the gains (or
|
||||
losses, or fees, or cost), it calculates the hypothetical annual rate
|
||||
of fixed rate investment that would have provided the exact same cash
|
||||
flow. See the package page for more.
|
||||
|
||||
print-unique
|
||||
Print only only journal entries which have a unique description.
|
||||
|
||||
$ cat unique.journal
|
||||
1/1 test
|
||||
(acct:one) 1
|
||||
2/2 test
|
||||
(acct:two) 2
|
||||
$ LEDGER_FILE=unique.journal hledger print-unique
|
||||
(-f option not supported)
|
||||
2015/01/01 test
|
||||
(acct:one) 1
|
||||
|
||||
rewrite
|
||||
Prints all journal entries, adding specified custom postings to matched
|
||||
entries.
|
||||
|
||||
hledger-rewrite.hs, in hledger's extra directory (compilation
|
||||
optional), adds postings to existing transactions, optionally with an
|
||||
amount based on the existing transaction's first amount. See the
|
||||
script for more details.
|
||||
|
||||
$ hledger rewrite -- [QUERY] --add-posting "ACCT AMTEXPR" ...
|
||||
$ hledger rewrite -- ^income --add-posting '(liabilities:tax) *.33'
|
||||
$ hledger rewrite -- expenses:gifts --add-posting '(budget:gifts) *-1"'
|
||||
|
||||
ui
|
||||
Curses-style interface, see hledger-ui.
|
||||
|
||||
web
|
||||
Web interface, see hledger-web.
|
||||
|
||||
Third party add-ons
|
||||
These are maintained separately from hledger, and usually updated
|
||||
shortly after a hledger release.
|
||||
|
||||
diff
|
||||
hledger-diff Shows differences in an account's transactions between one
|
||||
journal file and another.
|
||||
|
||||
iadd
|
||||
hledger-iadd A curses-style, more interactive replacement for the add
|
||||
command.
|
||||
|
||||
interest
|
||||
hledger-interest Generates interest transactions for an account accord-
|
||||
ing to various schemes.
|
||||
|
||||
irr
|
||||
hledger-irr Calculates the internal rate of return of an investment
|
||||
account.
|
||||
|
||||
Experimental add-ons
|
||||
These add-ons are available in source form in the hledger repo.
|
||||
Installing them is pretty easy. Reading and copying these is a good
|
||||
way to start making your own add-ons.
|
||||
|
||||
budget
|
||||
hledger-budget.hs A tool adding more budget-tracking features to
|
||||
hledger.
|
||||
|
||||
chart
|
||||
hledger-chart.hs An old pie chart generator, in need of some love.
|
||||
|
||||
check-dates
|
||||
hledger-check-dates.hs Checks that journal entries are ordered by date.
|
||||
|
||||
dupes
|
||||
hledger-dupes.hs Checks for account names sharing the same leaf name.
|
||||
|
||||
equity
|
||||
hledger-equity.hs Prints balance-resetting transactions useful for
|
||||
bringing account balances across file boundaries.
|
||||
|
||||
print-unique
|
||||
hledger-print-unique.hs Prints transactions which do not reuse an
|
||||
already-seen description.
|
||||
|
||||
register-match
|
||||
hledger-register-match.hs Helps ledger-autosync recognise
|
||||
already-imported transactions.
|
||||
|
||||
rewrite
|
||||
hledger-rewrite.hs Adds one or more custom postings to matched transac-
|
||||
tions.
|
||||
|
||||
TROUBLESHOOTING
|
||||
Run-time problems
|
||||
Here are some issues you might encounter when you run hledger (and
|
||||
remember you can also seek help from the IRC channel, mail list or bug
|
||||
Here are some issues you might encounter when you run hledger (and
|
||||
remember you can also seek help from the IRC channel, mail list or bug
|
||||
tracker):
|
||||
|
||||
Successfully installed, but "No command 'hledger' found"
|
||||
stack and cabal install binaries into a special directory, which should
|
||||
be added to your PATH environment variable. Eg on unix-like systems,
|
||||
be added to your PATH environment variable. Eg on unix-like systems,
|
||||
that is ~/.local/bin and ~/.cabal/bin respectively.
|
||||
|
||||
I set a custom LEDGER_FILE, but hledger is still using the default file
|
||||
LEDGER_FILE should be a real environment variable, not just a shell
|
||||
variable. The command env | grep LEDGER_FILE should show it. You may
|
||||
LEDGER_FILE should be a real environment variable, not just a shell
|
||||
variable. The command env | grep LEDGER_FILE should show it. You may
|
||||
need to use export. Here's an explanation.
|
||||
|
||||
"Illegal byte sequence" or "Invalid or incomplete multibyte or wide
|
||||
"Illegal byte sequence" or "Invalid or incomplete multibyte or wide
|
||||
character" errors
|
||||
In order to handle non-ascii letters and symbols (like ), hledger needs
|
||||
an appropriate locale. This is usually configured system-wide; you can
|
||||
also configure it temporarily. The locale may need to be one that sup-
|
||||
ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always,
|
||||
ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always,
|
||||
I'm not sure yet).
|
||||
|
||||
Here's an example of setting the locale temporarily, on ubuntu
|
||||
@ -1909,7 +1672,7 @@ TROUBLESHOOTING
|
||||
$ echo "export LANG=en_US.UTF-8" >>~/.bash_profile
|
||||
$ bash --login
|
||||
|
||||
If we preferred to use eg fr_FR.utf8, we might have to install that
|
||||
If we preferred to use eg fr_FR.utf8, we might have to install that
|
||||
first:
|
||||
|
||||
$ apt-get install language-pack-fr
|
||||
@ -1930,45 +1693,45 @@ TROUBLESHOOTING
|
||||
Known limitations
|
||||
Command line interface
|
||||
|
||||
Add-on command options, unless they are also understood by the main
|
||||
hledger executable, must be written after --, like this:
|
||||
Add-on command options, unless they are also understood by the main
|
||||
hledger executable, must be written after --, like this:
|
||||
hledger web -- --server
|
||||
|
||||
Differences from Ledger
|
||||
|
||||
Not all of Ledger's journal file syntax is supported. See file format
|
||||
Not all of Ledger's journal file syntax is supported. See file format
|
||||
differences.
|
||||
|
||||
hledger is slower than Ledger, and uses more memory, on large data
|
||||
hledger is slower than Ledger, and uses more memory, on large data
|
||||
files.
|
||||
|
||||
Windows limitations
|
||||
|
||||
In a windows CMD window, non-ascii characters and colours are not sup-
|
||||
In a windows CMD window, non-ascii characters and colours are not sup-
|
||||
ported.
|
||||
|
||||
In a windows Cygwin/MSYS/Mintty window, the tab key is not supported in
|
||||
hledger add.
|
||||
|
||||
ENVIRONMENT
|
||||
COLUMNS The screen width used by the register command. Default: the
|
||||
COLUMNS The screen width used by the register command. Default: the
|
||||
full terminal width.
|
||||
|
||||
LEDGER_FILE The journal file path when not specified with -f. Default:
|
||||
~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-
|
||||
~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-
|
||||
nal).
|
||||
|
||||
FILES
|
||||
Reads data from one or more files in hledger journal, timeclock, time-
|
||||
dot, or CSV format specified with -f, or $LEDGER_FILE, or
|
||||
$HOME/.hledger.journal (on windows, perhaps
|
||||
Reads data from one or more files in hledger journal, timeclock, time-
|
||||
dot, or CSV format specified with -f, or $LEDGER_FILE, or
|
||||
$HOME/.hledger.journal (on windows, perhaps
|
||||
C:/Users/USER/.hledger.journal).
|
||||
|
||||
BUGS
|
||||
The need to precede options with -- when invoked from hledger is awk-
|
||||
The need to precede options with -- when invoked from hledger is awk-
|
||||
ward.
|
||||
|
||||
hledger can't render non-ascii characters when run from a Windows com-
|
||||
hledger can't render non-ascii characters when run from a Windows com-
|
||||
mand prompt (up to Windows 7 at least).
|
||||
|
||||
When input data contains non-ascii characters, a suitable system locale
|
||||
@ -1978,7 +1741,7 @@ BUGS
|
||||
|
||||
|
||||
REPORTING BUGS
|
||||
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
|
||||
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
|
||||
or hledger mail list)
|
||||
|
||||
|
||||
@ -1992,7 +1755,7 @@ COPYRIGHT
|
||||
|
||||
|
||||
SEE ALSO
|
||||
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
|
||||
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
|
||||
hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time-
|
||||
dot(5), ledger(1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user