command line accounting tool
As a former CPA, I could not resist building my own accounting system.
yaml
files as data storecsv
files to yaml
formatCODE_OF_CONDUCT.md
for fundamental guidelinesinstall via cargo - cargo install rust_ledger
Alternatively, clone this repo and do the following:
cargo build --release
to compile the binary/target/release
and copy the rust_ledger
binary in your path: /usr/bin
rust_ledger -l LEDGER_FILE_PATH COMMAND -f OPTION
LEDGERFILEPATH (denoted by -l
) - relative path to location of yaml ledger file
RLEDGER_FILE
in lieu of specifying whenever the program is invoked.-l
is provided with a file path the file provided will be used instead of any RLEDGER_FILE
set.
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.
RLEDGER_FILE
- Path to rledger file. ex: RLEDGER_FILE=~/rledger.yaml
NO_COLOR
- Disables color output. ex: NO_COLOR=true
cargo test
```
checking asset
savings asset
creditcard liability
equity equity
expenseauto expense
expensecomputer expense
expensefood expense
expensegasoline expense
expensepets expense
expenseamazon expense
expensehome expense
expensegeneral expense
incomegeneral income
```
```
asset
checking 1,300
savings 2,000
liability
creditcard -456
equity
equity -3,500
expense
expenseauto 455
expensecomputer 1
expensefood 0
expensegasoline 0
expensepets 0
expenseamazon 0
expensehome 100
expensegeneral 0
income
incomegeneral 0
check -100 ```
```
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 ```
csv
files to yaml
format expected by rust_ledger
csv
formatcsv
file into the tool, you must rename the columns in the first line of the csv
file in the following schema:
"date","transaction","name","memo","amount"
yaml
file formatyaml
files in the following 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 ```