ledger

module
v0.0.0-...-5c847d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2021 License: BSD-3-Clause

README

Build Coverage API Documentation BSD License

Go Ledger

Library and binaries to parse relatively complex Ledger files, and provide an abstract syntax tree (a full programmatic representation of the file), to be able to tweak some parts programmatically, and then write back the files to disk.

It has a few higher level APIs added by https://github.com/cschomburg and https://github.com/glasser Many thanks for your contributions!

  • ledger-go provides a few tools to interact with Ledger files, such as balance reports.

  • ledgerfmt, similar to gofmt, parses the input file, indents and aligns according to conventions, and outputs the file back, without any semantic changes or interpretation of the data.

  • ledger2json parses your Ledger file and outputs a .json file, which you can manipulate with any software.

Installation

go get -u github.com/abourget/ledger/cmd/...

Shortcomings

This implementation has a few limitations compared to the C++ version:

  • The current implementation does not validate any balances. It merely acts on the text of the file.
  • It does not yet support all top-level constructs, like "account", "alias", "P", "D", "year" / "Y", etc.. Most of those should be simple to implement.
  • It does not yet understand tags. They are only considered comments.
  • It does not yet implement the value_expr language that allows you to do complex math computations directly in the postings of your transactions. It merely store the string text of the expression, PROVIDED it is enclosed in parenthesis, e.g. (123 + 2 * 3 USD).

Directories

Path Synopsis
cmd
budgeteer
Budgeteer is an experimental monthly budget calculator.
Budgeteer is an experimental monthly budget calculator.
ledger-go
Ledger-Go is a Go implementation of the Ledger cli tool.
Ledger-Go is a Go implementation of the Ledger cli tool.
ledger2json
ledger2json parses a ledger file and returns a JSON representation.
ledger2json parses a ledger file and returns a JSON representation.
ledgerfmt
ledgerfmt pretty-prints ledger files.
ledgerfmt pretty-prints ledger files.
Package journal provides a simple interface for accessing ledger files.
Package journal provides a simple interface for accessing ledger files.
Package lpath provides support for manipulating colon-separated account names.
Package lpath provides support for manipulating colon-separated account names.
Package parse implements a low-level parser of ledger files.
Package parse implements a low-level parser of ledger files.
Package print provides a low-level writer for ledger files.
Package print provides a low-level writer for ledger files.
tools
budget
Package budget provides an experimental budget calculator.
Package budget provides an experimental budget calculator.
filter
Package filter provides a simple tool to filter ledger transactions
Package filter provides a simple tool to filter ledger transactions
reports
Package reports provides simple aggregation and reporting of ledger files.
Package reports provides simple aggregation and reporting of ledger files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL