Abacus-rs
A cli plain-text accounting program
This tool was writen for my own purposes, though anyone is welcome to use it or contribute. But if you are serious about plain-text accounting, please consider using ledger, hledger or beancount. Or visit plaintextaccounting.org to learn more about it.
For another rust based approach, you can also check rust_ledger, where I took some inspiration from.
Features
- Double-entry like account keeping.
- Uses toml text format.
- Import of transactions from csv.
- Balance and Journal reports.
- Group balances by Month, Quarter or Year.
Usage
)
An abacus ledger is toml file, or mutliple toml files, that include accounts, transaction and optionaly, prices.
Running any command requires declaring the path to the ledger.
Accounts
An account is declared with a specific type; Assets, Liabilities, Expenses, Income, Equity, Stock, MutualFund, Holding or Cash.
The account currency can be declared with any terminology.
[[]]
= 2023-09-30
= "Savings Account"
= "Assets"
= "USD"
[[]]
= 2023-09-30
= "Dining"
= "Expenses"
= "USD"
An optional opening balance can be included.
[[]]
= 2023-09-30
= "Savings Account"
= "Assets"
= "USD"
= 1000.00
Transactions
Transactions require a date (in YYYY-MM-DD format), an amount (float or integer), an account and an offset_account. The Offset Amount and Quantity can be explicity declared, otherwise it will be set as the inverse of the amount and to one (1) respectively. Payee and note are optional fields.
[[]]
= 2023-10-03
= 100.00
= "Dining"
= "Savings Account"
= -100.00 # optional
= 1 # optional
= "RESTAURAN X" # optional
= "Meal was good" # optional
Prices
Declaring Commodity prices is entirely optional but very useful to price stocks or currencies.
[[]]
= 2023-10-02
= "ARS"
= 0.00125
= "USD"
[[]]
= 2023-09-30
= "VOO"
= 390.50
= "USD"
Print Balances
Account balances are printed for all accounts by default.
Specific account classes can be passed with the -c option to print a more typical balance sheet view. The amount can also be priced at a specific currency, provided there is a price entry for it in the ledger.
> abacus-rs
Print Journal
A journal is a list of the existing transactions in the ledger.
Transactions can be filtered by year, account class, name or payee.
Example for listing only Dining expenses transacions.
> abacus-rs
| | |
| | |
| | |
| | |
Import transactions
To import transactions from a csv file some pre-formatting needs to be done to ensure the columns names are mapped with the same names as in the toml files.
Some banks provide statements in credit/debit format and other with sign or parenthesis for negative values, so some number formatting may also be required.
Running the import requires specifying the file where the toml transaction are to be imported and the csv file with the details.
Example of running the import script.
> abacus-rs