File: installation.md

package info (click to toggle)
ledger2beancount 2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 904 kB
  • sloc: perl: 1,920; sh: 151; makefile: 22
file content (94 lines) | stat: -rw-r--r-- 2,519 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Installation

ledger2beancount is a Perl script and relies on the following modules:

* `Date::Calc`
* `DateTime::Format::Strptime`
* `enum`
* `File::BaseDir`
* `Getopt::Long::Descriptive`
* `List::MoreUtils`
* `Regexp::Common`
* `String::Interpolate`
* `YAML::XS`

You can install the required Perl modules with
[cpanminus](https://metacpan.org/pod/distribution/App-cpanminus/bin/cpanm):

```shell
cpanm --installdeps .
```

If you use Debian, you can install the dependencies with this command:

```shell
sudo apt install libdate-calc-perl libdatetime-format-strptime-perl \
    libenum-perl libfile-basedir-perl libgetopt-long-descriptive-perl \
    liblist-moreutils-perl libregexp-common-perl \
    libstring-interpolate-perl libyaml-libyaml-perl
```

Note that `String::Interpolate` (`libstring-interpolate-perl`) was not
released as part of Debian 10 (buster) but is available via
[buster-backports](https://backports.debian.org/).

ledger2beancount itself consists of one script.  You can clone the
repository and run the script directly or copy it to `$HOME/bin` or
a similar location:

```shell
git clone https://github.com/beancount/ledger2beancount/
cd ledger2beancount
./bin/ledger2beancount examples/simple.ledger
```

## Arch Linux

ledger2beancount is available on [AUR](https://aur.archlinux.org/packages/ledger2beancount/).

## Debian

ledger2beancount is [available in Debian](https://packages.debian.org/ledger2beancount).

## Docker

You can create a Docker image for ledger2beancount using the `Dockerfile`
that's part of ledger2beancount's Git repository:

```shell
git clone https://github.com/beancount/ledger2beancount/
cd ledger2beancount
DOCKER_BUILDKIT=1 docker image build -t <IMAGENAME> .
```

Now you can run ledger2beancount like this:

```shell
docker run --rm -v <HOSTDIR>:/usr/ledger2beancount/docker:rw <IMAGENAME> docker/<LEDGER FILE>
```

## macOS

You can install Perl and `cpanm` from Homebrew:

```shell
brew install perl
brew install cpanminus
```

## Microsoft Windows

You can install [Strawberry Perl](http://strawberryperl.com/) on Windows
and use `cpanm` as described above to install the required Perl modules.
ledger2beancount is not packaged for Windows but you can clone this Git
repository and run the script.

## pkgsrc

ledger2beancount is [available for pkgsrc](https://pkgsrc.se/finance/ledger2beancount)
which is used on NetBSD and other operating systems.

## Ubuntu

ledger2beancount is [available in Ubuntu](https://packages.ubuntu.com/ledger2beancount).