expenses

command module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 1 Imported by: 0

README

Expenses GitHub release build

An interactive command line expense logger. Answer a series of questions to log your expenses. Currently writes to CSV and SQLite backends.

Installation

You can download pre-built binaries for Linux, macOS and Windows here. Just add the binary to your path and you're good to go!

Alternative methods

Alternatively, if you have go installed, you can use go get to directly download the package from the master branch:

go get github.com/manojkarthick/expenses

If you are a nix user, you can install expenses from nixpkgs

nix-env --install expenses

or, if you manager your installation using home-manager, add to your home.packages:

home.packages = [
    pkgs.expenses
]; 
Building from source

You can use the Makefile present in the directory to build the project. Make sure you have Golang v1.14.x installed on your system.

git clone https://github.com/manojkarthick/expenses.git
cd expenses
make dev-build
./expenses help

Running

To add a new expense, run expenses add and answer the questions that follow. Example below:

$ expenses add
? What did you buy? Cookies
? Cost? 2.99
? Where did you buy this? Trader Joes
? Please select the item's categories Food
? Source of Funds? Chequing
? Any notes?
? Transaction date Today

View the tool in action here:

asciicast

Available Commands

Run expenses help to view the list of commands available:

A simple command line utility to log your expenses

Usage:
  expenses [command]

Available Commands:
  add         Log your expenses to the file/database
  config      Show the current configuration used by expenses
  delete      Delete expenses by transaction id
  help        Help about any command
  show        Show contents of the CSV or SQLite database created by the program
  version     Show application version information

Flags:
      --config string   config file (default is $HOME/.expenses.yaml)
  -h, --help            help for expenses
      --verbose         use verbose logging

Use "expenses [command] --help" for more information about a command.
  • To add a new expense: expenses add
  • View the current version: expenses version
  • View the configuration used: expenses config
  • Show the expenses: expenses show db or expenses show csv
  • Delete expenses: expenses delete --transaction <transaction_ids>
Sample Output

To view the expenses currently logged, run expenses show db or expenses show csv.

+--------------------------------------+------------+---------+----------+-------------+----------+----------+
|            TRANSACTION ID            |    DATE    |  ITEM   |   COST   |  LOCATION   | CATEGORY |  SOURCE  |
+--------------------------------------+------------+---------+----------+-------------+----------+----------+
| fb96cf93-b096-4137-ad8b-b60a3bf08045 | 2020/12/31 | Cookies | 2.990000 | Trader Joes | Food     | Chequing |
| 3d275a44-76a2-4162-942d-d8901cae2c82 | 2020/12/30 | Coffee  | 4.990000 | Starbucks   | Food     | Cash     |
+--------------------------------------+------------+---------+----------+-------------+----------+----------+
Configuration

Expenses allows you to configure values such as the database name, csv file name, categories for expenses, source of funds, etc.

Create a file under your home directory called .expenses.yaml. You can modify the following fields in the config file:

  1. dbName: Name of the SQLite3 database to commit to (default = expenses.db)
  2. disableDb: Set to true if you don't want to write to database (default = false)
  3. csvName: Name of the CSV file to write to (default = expenses.csv)
  4. disableCSV: Set to true if you don't want to write to the CSV file (default = false)
  5. categories: Provide an alternate list of categories for your expenses to show during the interactive prompt (default = Rent/Mortgage, Food, Utilities, Maintenance, Living, Health, Electronics, Hygiene, Travel, Education)
  6. funds: Provide possible source of funds for the expense (default = VISA, Mastercard, Chequing, Savings, Cash, PayPal)
TODO
  • Statistics/Spending reports by Time period and category

Documentation

Overview

Copyright © 2020 Manoj Karthick Selva Kumar <manojkarthick@ymail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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