Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/md-arif-shaikh/expenses
Recording and viewing expenses using Emacs
https://github.com/md-arif-shaikh/expenses
emacs emacs-lisp expense-manager expense-tracker expenses-monitoring
Last synced: 3 months ago
JSON representation
Recording and viewing expenses using Emacs
- Host: GitHub
- URL: https://github.com/md-arif-shaikh/expenses
- Owner: md-arif-shaikh
- License: gpl-3.0
- Created: 2021-11-27T14:39:02.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-03T03:09:45.000Z (about 1 year ago)
- Last Synced: 2024-02-17T07:36:28.310Z (9 months ago)
- Topics: emacs, emacs-lisp, expense-manager, expense-tracker, expenses-monitoring
- Language: Emacs Lisp
- Homepage:
- Size: 1.09 MB
- Stars: 26
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
#+TITLE: Expenses
#+AUTHOR: Md Arif Shaikh
#+EMAIL: [email protected]#+html:
* Table of Contents :TOC:
- [[#about-expenses][About Expenses]]
- [[#how-to-install][How to install]]
- [[#custom-settings][Custom settings]]
- [[#importing-bank-statements][Importing Bank Statements]]
- [[#import-bank-statements-with-profile][Import bank statements with profile]]
- [[#auto-assign-categories][Auto assign categories]]
- [[#override-phrases-and-keywords][Override phrases and keywords]]
- [[#ignore-transaction][Ignore transaction]]
- [[#interactive-functions][Interactive functions]]
- [[#screenshots][Screenshots]]
- [[#expenses-add-expense][expenses-add-expense]]
- [[#expenses-calc-expense-for-day][expenses-calc-expense-for-day]]
- [[#expenses-calc-expense-for-month][expenses-calc-expense-for-month]]
- [[#expenses-calc-expense-for-monthsexpenses-calc-expense-for-year][expenses-calc-expense-for-months/expenses-calc-expense-for-year]]
- [[#expenses-calc-expense-by-category][expenses-calc-expense-by-category]]
- [[#expenses-pie-expense-for-month-filtered-by-categories][expenses-pie-expense-for-month-filtered-by-categories]]* 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 [[https://melpa.org/][MELPA]]. With ~use-package~ you can do something like
#+BEGIN_SRC emacs-lisp
(use-package expenses
:ensure t)
#+END_SRC
or if you use ~straight~ then
#+BEGIN_SRC emacs-lisp
(use-package expenses
:straight t)
#+END_SRC* Custom settings
- *Directory for saving the expense* ~org~ *files*
#+BEGIN_SRC emacs-lisp
(setq expenses-directory "/path/to/directory")
#+END_SRC
- *Category list for expenses*
#+BEGIN_SRC emacs-lisp
(setq expenses-category-list '("Bike" "Car" "Clothes" "Coffee" "Electronics" "Entertainment" "Fee" "Food" "Gift" "Health" "Home" "Petrol" "Other" "Sport" "Subscriptions" "Travel" "Transfer" "Utilities"))
#+END_SRC
- *Currency*
#+BEGIN_SRC emacs-lisp
(setq expenses-currency "$")
#+END_SRC* 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)~
#+BEGIN_SRC emacs-lisp
(setq expenses-bank-profiles (("EXAMPLE-BANK" "," 1 3 "dd/mm/yyyy" 2 -1)
("ANOTHER-BANK" "\t" 1 4 "yyyy/mm/dd" 2 3)))
#+END_SRC
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
#+BEGIN_SRC emacs-lisp
(setq expenses-utils-auto-assign-categies-on-import t)
#+END_SRC
** Override phrases and keywords
You can override the default phrases and keywords in your init.el file with the following
#+begin_src emacs-lisp
(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")))
#+end_src
** 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,
#+BEGIN_SRC emacs-lisp
(setq expenses-utils-ignore-keywords-list '("keyword1" "keyword2"))
(setq expenses-utils-ignore-phrases-list '("this is phrase one" "this is phrase 2"))
#+END_SRC
* Interactive functions
|-------------------------------------------------------+----------------------------------------------------------------------|
| Interactive functions | Actions |
|-------------------------------------------------------+----------------------------------------------------------------------|
| ~expenses-add-expense~ | Add an expense entry |
|-------------------------------------------------------+----------------------------------------------------------------------|
| ~expenses-view-expense~ | View expense file |
|-------------------------------------------------------+----------------------------------------------------------------------|
| ~expenses-calc-expense-for-day~ | Calculate expenses in a day |
|-------------------------------------------------------+----------------------------------------------------------------------|
| ~expenses-calc-expense-for-month~ | Calculate expenses in a month |
|-------------------------------------------------------+----------------------------------------------------------------------|
| ~expenses-calc-expense-for-months~ | Calculate expenses in a range of months |
|-------------------------------------------------------+----------------------------------------------------------------------|
| ~expenses-calc-expense-for-year~ | Calculate expenses in a year |
|-------------------------------------------------------+----------------------------------------------------------------------|
| ~expenses-calc-expense-by-category~ | Calculate expenses in one or more category for a given date or month |
|-------------------------------------------------------+----------------------------------------------------------------------|
| ~expenses-import-expense~ | Import expense from CSV files |
|-------------------------------------------------------+----------------------------------------------------------------------|
| ~expenses-pie-expense-for-month-filtered-by-categories~ | Create a pie chart of expenses in different categories |
|-------------------------------------------------------+----------------------------------------------------------------------|
| ~expenses-import-expense-with-bank-profile~ | Import expense from CSV files using user customized profiles |
|-------------------------------------------------------+----------------------------------------------------------------------|
* Screenshots
** expenses-add-expense
#+html:
** expenses-calc-expense-for-day
#+html:
#+html:
** expenses-calc-expense-for-month
#+html:
#+html:
** expenses-calc-expense-for-months/expenses-calc-expense-for-year
#+html:
** expenses-calc-expense-by-category
#+html:
** expenses-pie-expense-for-month-filtered-by-categories
#+html: