Latest version Documentation

rust_ledger

command line accounting tool

As a former CPA, I could not resist building my own accounting system.

Summary

Contributing

Install

From Cargo

install via cargo - cargo install rust_ledger

Build from Source

Alternatively, clone this repo and do the following:

Usage

rust_ledger -l LEDGER_FILE_PATH COMMAND -f OPTION

LEDGERFILEPATH (denoted by -l) - relative path to location of yaml ledger file

RLEDGER_FILE=~/rledger.yaml rust_ledger balances

RLEDGER_FILE can be set as a system or user environment variable.

export RLEDGER_FILE="$HOME/rledger.yaml"

COMMAND - ledger command (accounts, balance, register, or csv)

OPTION (denoted by -f) - allows you to filter the output of the register command by account type. For example, if you wish to only see "expense" transactions in the output, you would pass in expense as the option here.

Environment Variables

RLEDGER_FILE - Path to rledger file. ex: RLEDGER_FILE=~/rledger.yaml

NO_COLOR - Disables color output. ex: NO_COLOR=true

Test

API

```

Account Type

checking asset
savings asset
creditcard liability
equity equity
expense
auto expense
expensecomputer expense
expense
food expense
expensegasoline expense
expense
pets expense
expenseamazon expense
expense
home expense
expensegeneral expense
income
general income
```

```

Account Balance

asset checking 1,300
savings 2,000
liability creditcard -456
equity equity -3,500
expense expense
auto 455
expensecomputer 1
expense
food 0
expensegasoline 0
expense
pets 0
expenseamazon 0
expense
home 100
expensegeneral 0
income income
general 0


check -100 ```

```

Date Description Accounts

11/4/2019 car maintenance expenseauto 455 455 creditcard -455 0 11/4/2019 raspberry pi expensecomputer 1 1 creditcard -1 0 05/12/2020 stuff expense_home 100 100 checkings -100 0 ```

rust_ledger yaml file format

```yaml owner: test_owner currencies: id: $ name: US Dollar alias: USD note: Currency used in the United States

accounts: - id: 0 acctname: checking accttype: asset debitcredit: 1500 - id: 1 acctname: savings accttype: asset debitcredit: 2000 - id: 3 acctname: creditcard accttype: liability debitcredit: 0 - id: 4 acctname: equity accttype: equity debitcredit: -3500 - id: 5 acctname: expenseauto accttype: expense debitcredit: 0 - id: 6 acctname: expensecomputer accttype: expense debitcredit: 0 - id: 7 acctname: expensefood accttype: expense debitcredit: 0 - id: 8 acctname: expensegasoline accttype: expense debitcredit: 0 - id: 9 acctname: expensepets accttype: expense debitcredit: 0 - id: 10 acctname: expenseamazon accttype: expense debitcredit: 0 - id: 11 acctname: expensehome accttype: expense debitcredit: 0 - id: 12 acctname: expensegeneral accttype: expense debitcredit: 0 - id: 13 acctname: incomegeneral accttype: income debit_credit: 0

transactions: - date: 11/4/2019 debitcredit: 455 acctoffsetname: creditcard name: car maintenance accttype: expense acctname: expenseauto - date: 11/4/2019 debitcredit: 1 acctoffsetname: creditcard name: raspberry pi accttype: expense acctname: expensecomputer ```