Skip to content

Commit

Permalink
readme points to web doc
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Jan 15, 2022
1 parent 6b72999 commit 6bfb124
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 102 deletions.
115 changes: 13 additions & 102 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,111 +2,22 @@
[![GitHub downloads](https://img.shields.io/github/downloads/howeyc/ledger/total.svg?logo=github&logoColor=lime)](https://github.com/howeyc/ledger/releases)
[![Chat on Libera](https://img.shields.io/badge/chat-libera-blue.svg)](https://matrix.to/#/#plaintextaccounting:libera.chat)
[![Go Report Card](https://goreportcard.com/badge/github.com/howeyc/ledger)](https://goreportcard.com/report/github.com/howeyc/ledger)
[![Go Reference](https://pkg.go.dev/badge/github.com/howeyc/ledger.svg)](https://pkg.go.dev/github.com/howeyc/ledger)

# Ledger in Go
<div align="center">
<img src="logo.png" width="20%" height="20%" alt="ledger-logo">
</div>

This is a project to parse and import transactions in a ledger file similar
to the [Ledger](http://ledger-cli.org) command line tool written in C++.
## Purpose

## Simple Ledger file support
Ledger is a command line application for plain text accounting. Providing
commands to view balances, register of transactions, importing of CSV files,
and a web interface to view reports, and track investments.

The ledger file this will parse is much simpler than the C++ tool.
## Documentation

Transaction Format:
Head over to https://howeyc.github.io/ledger/

<YYYY/MM/dd> <Payee description>
<Account Name 1> <Amount 1>
.
.
.
<Account Name N> <Amount N>

The transaction must balance (the positive amounts must equal negative amounts).
One of the account lines is allowed to have no amount. The amount necessary
to balance the transaction will be added to that account for the transaction.
Amounts must be decimal numbers with a negative(-) sign in front if necessary.

Example transaction:

2013/01/02 McDonald's #24233 HOUSTON TX
Expenses:Dining Out:Fast Food 5.60
Wallet:Cash

A ledger file is a list of transactions separated by a blank line.

A ledger file may include other ledger files using `include <filepath>`. The
`filepath` is relative to the including file.


## ledger lib

This will parse a ledger file into an array of Transaction structs.
There is also a function get balances for all accounts in the ledger file.

[GoDoc](https://pkg.go.dev/github.com/howeyc/ledger/)

## Command Use

### Basic Commands

Example usage:
```sh
export LEDGER_FILE="ledger.dat"

ledger bal
ledger bal Cash
ledger reg
ledger print
ledger stats
ledger lint

ledger -f other_ledger.dat reg
```

### Import Transactions

Using an existing ledger as input to a bayesian classifier, it will attempt to
classify an imported csv of transactions based on payee names and print them in
a ledger file format.

Attempts to get payee, date, and amount based on headers in the csv file.

Example usage:
```sh
ledger -f ledger.dat import discover discover-recent-transactions.csv
```

In the above example "discover" is the account search string to use to find
the account that all transactions in the csv file should be applied too. The
second account to use for each transaction will be picked based on the
bayesian classification of the payee.

### Web Service

A website view of the ledger file. This program will show the account list,
and ledger for a given account.

Reports available through the web interface are taken from a toml configuration
file of the report configuration. See reports-sample.toml for examples.

Example usage:
```sh
ledger -f ledger.dat web -r reports.toml --port 8080
```

#### Screenshots

The screenshots below are taken on an Android device. To give a rough idea of what the web interface looks like.

<img width=200 src="ledger/cmd/web_screenshots/index.png"> <img width=200 src="ledger/cmd/web_screenshots/nav.png"> <img width=200 src="ledger/cmd/web_screenshots/navreports.png">
<img width=200 src="ledger/cmd/web_screenshots/bar.png"> <img width=200 src="ledger/cmd/web_screenshots/stackedbar.png"> <img width=200 src="ledger/cmd/web_screenshots/pie.png"> <img width=200 src="ledger/cmd/web_screenshots/line.png">

## Installing components

Download the binary for your platform from the [Github Releases](https://github.com/howeyc/ledger/releases) page.

## Incompatibilities

- C++ Ledger permits having amounts prefixed with $; Ledger in Go does not

- C++ Ledger permits an empty *Payee Description*; Ledger in Go does not
## License
Ledger is made available under the terms of the ICS License. See the
LICENSE.txt file for full text of the license.
Binary file removed ledger/cmd/web_screenshots/bar.png
Binary file not shown.
Binary file removed ledger/cmd/web_screenshots/index.png
Binary file not shown.
Binary file removed ledger/cmd/web_screenshots/line.png
Binary file not shown.
Binary file removed ledger/cmd/web_screenshots/nav.png
Binary file not shown.
Binary file removed ledger/cmd/web_screenshots/navreports.png
Binary file not shown.
Binary file removed ledger/cmd/web_screenshots/pie.png
Binary file not shown.
Binary file removed ledger/cmd/web_screenshots/stackedbar.png
Binary file not shown.
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6bfb124

Please sign in to comment.