Skip to content

md-arif-shaikh/expenses

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expenses

GitHub MELPA

Table of Contents

About Expenses

Expenses is an Emacs package to keep records of your expenses and view expenses conveniently.

  • Expenses could be calculated for given date/month/months/year.
  • Expenses could be filtered by one or more categories for a given time period.
  • Expenses could be imported from CSV files and entries would be added to appropriate files.
  • It saves the expenses in an org-table inside an org file.
  • For each month, a separate org file is created with the year and month as a prefix to the file names.
  • It uses the org-table formulas to calculate expenses for the given period.
  • Expenses could be tracked per user basis

How to install

Expenses is available in MELPA. With use-package you can do something like

(use-package expenses
  :ensure t)

or if you use straight then

(use-package expenses
  :straight t)

Custom settings

  • Directory for saving the expense org files
    (setq expenses-directory "/path/to/directory")
        
  • Category list for expenses
    (setq expenses-category-list '("Bike" "Car" "Clothes" "Coffee" "Electronics" "Entertainment" "Fee" "Food" "Gift" "Health" "Home" "Petrol" "Other" "Sport" "Subscriptions" "Travel" "Transfer" "Utilities"))
        
  • Currency
    (setq expenses-currency "$")
        

Importing Bank Statements

You can import directly from Bank CSV exports using expenses-import-expense. Example CSV export from a bank

Bank Account,Date,Narrative,Debit Amount,Credit Amount,Balance,Categories,Serial
5544,05/12/2021,"THAT CAFE SYDNEY AUS",4.00,,0.00,OTHER,

First look at the CSV to determine the order remember that it starts at zero for the first column. NOTE: If category is set to -1 then you will be prompted to assign categories for each line.

Import bank statements with profile

To be able to import expenses from bank statements conveniently, you can set profiles for your banks using the varibale expenses-bank-profiles. This is a list where each element is of the form (bank-name sep date-col debit-col date-format narrative-col category-col)

(setq expenses-bank-profiles (("EXAMPLE-BANK" "," 1 3 "dd/mm/yyyy" 2 -1)
				("ANOTHER-BANK" "\t" 1 4 "yyyy/mm/dd" 2 3)))

Then you import bank statements using expenses-import-expense-with-bank-profile

Auto assign categories

You can auto assign based on keyword or phrase. To turn this on first do the following

(setq expenses-utils-auto-assign-categies-on-import t)

Override phrases and keywords

You can override the default phrases and keywords in your init.el file with the following

(require 'ht)
(setq expenses-utils-phrases-alist '(("BUDGET DIRECT" . "Car")
				       ("WW METRO" . "Petrol")
				       ("RS COMPONENTS" . "Electronics")))
(setq expenses-utils-keyword-category-ht (ht ("7-ELEVEN" "Petrol")
					       ("BP" "Petrol")
					       ("CALTEX" "Petrol")
					       ("UNITED" "Petrol")
					       ("GYM" "Sport")
					       ("YOUTUBE" "Subscriptions")
					       ("MYKI" "Travel")
					       ("WATER" "Utilities")))

Ignore transaction

Sometime you may want to ignore some transactions. This could be done by providing a list of keywords or a list of phrases. While importing your bank statements, it would look for words or phrases in the provided lists and ignore the transaction if it finds one. There are two varibales to set here. First one is the expenses-utils-ignore-keywords-list for providing a list of keywords and the second one is the expenses-utils-ignore-phrases-list for providing a list of phrases. Examples,

(setq expenses-utils-ignore-keywords-list '("keyword1" "keyword2"))
(setq expenses-utils-ignore-phrases-list '("this is phrase one" "this is phrase 2"))

Interactive functions

Interactive functionsActions
expenses-add-expenseAdd an expense entry
expenses-view-expenseView expense file
expenses-calc-expense-for-dayCalculate expenses in a day
expenses-calc-expense-for-monthCalculate expenses in a month
expenses-calc-expense-for-monthsCalculate expenses in a range of months
expenses-calc-expense-for-yearCalculate expenses in a year
expenses-calc-expense-by-categoryCalculate expenses in one or more category for a given date or month
expenses-import-expenseImport expense from CSV files
expenses-pie-expense-for-month-filtered-by-categoriesCreate a pie chart of expenses in different categories
expenses-import-expense-with-bank-profileImport expense from CSV files using user customized profiles

Screenshots

expenses-add-expense

expenses-calc-expense-for-day

expenses-calc-expense-for-month

expenses-calc-expense-for-months/expenses-calc-expense-for-year

expenses-calc-expense-by-category

expenses-pie-expense-for-month-filtered-by-categories