A script to automatically convert Ledger-based textual ledgers to Beancount ones.
Conversion is based on (concrete) syntax, so that information that is not meaningful for accounting reasons but still valuable (e.g., comments, formatting, etc.) can be preserved.
ledger2beancount supports the file formats from:
ledger2beancount accepts input from stdin
or from a file and will write
the converted data to stdout
. You can run ledger2beancount like this:
ledger2beancount test.ledger > test.beancount
Please see the installation information for dependencies and installation instructions.
ledger2beancount comes with extensive documentation. You can also read the documentation online thanks to Read the Docs.
The majority of features from ledger are supported by ledger2beancount. Here is an overview of fully supported, partly supported and unsupported features. Please refer to the user guide for more details on how to use ledger2beancount and to configure it to your needs.
account ...
)apply account
alias
directive and the alias
sub-directive of account
declarations)comment
and test
commodity ...
)$
, £
and €
bucket
/ A
include
Year
/ Y
, apply year
apply tag
#tags
to ^links
D
(not supported in beancount)define
and def
(no functions)eval
: skipped (not supported in beancount)import
: skipped (not supported in beancount)payee
: skipped (not needed in beancount)python
: skipped (not supported in beancount)tag
: skipped (not needed in beancount)value
: skipped (not supported in beancount)=$10
and the fixed
directive)assert
C
(commodity equivalences)check
expr
N
I
, i
, O
, o
, b
, h
)commodity
and D
directivespayee | note
formatdate
and date2
tag1:, tag2:, tag2: info
D
(set default commodity)end aliases
<zack@upsilon.cc>
<tbm@cyrius.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
SPDX-License-Identifier: GPL-3.0-or-later