Coder Social home page Coder Social logo

md-arif-shaikh / expenses Goto Github PK

View Code? Open in Web Editor NEW
27.0 2.0 2.0 1.12 MB

Recording and viewing expenses using Emacs

License: GNU General Public License v3.0

Emacs Lisp 100.00%
emacs emacs-lisp expense-tracker expense-manager expenses-monitoring

expenses's Introduction

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

expenses's People

Contributors

map7 avatar md-arif-shaikh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

emacsmirror map7

expenses's Issues

Feature: Auto assign categories

Based on the description from your bank statement which is imported into the expenses plugin it would be nice to have a set of keywords and phrases which would auto-assign a categories to that line.

First it would look at the phrases to auto assign then failing that it would look at keywords.

eg;

cafe = food
hotel = food
Chemist = health
Zoo = entertainment

Then for any transactions left over which are not auto-assigned we can do this manually.

Feature: Import bank statements CSV

Most banks export to CSV and it would be great if the expenses plugin could import the CSV and create entries. If I looked at implementing this feature I think there would be common methods for which could be used between different bank exports, but then we would have to have a list of banks which have set profiles on which part of the CSV relates to what.

It would also be nice if once it imported it allowed you to assign to a category by just stepping through each new transaction, also I think there should be duplicate detection so that if you accidentally import your CSV twice or it overlaps a little then it will ignore existing data.

Is this a feature you would like in your plugin?

Feature: expenses-calc-expense-for-year-filtered-by-categories

It would be nice to have the same function we have for month, but for the whole year. It would also be nice if we could optionally sort the output in either category or dollar value (most expensive to least).

It would give us an idea of what we mostly spent our money on in a year.

Feature: Ignore phrase/keyword

As I've been using expenses for my monthly budgeting I have notice that I have a heap of transfers from one account to another and these are included in my expenses. I think a nice feature would be if we could setup a keyword/phrase which will automatically ignore certain transactions, or at lease have the ability to ignore it in reporting.

Calc error

Great package, just what I was looking for. However I get an error when I invoke the command expenses-calc-expense-for-months or expenses-calc-expense-for-month:
error "Marker does not point anywhere"
Any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.