using google sheet to manage expense
get a copy of the spreadsheet here
available apps that i have seen (for example, money lover), are not suitable for me for the following reasons:
- their data entry process, either manual entry, or SMS-based, or bank account linkage, which is limited to only some banks and costs extra money
- most require in-app purchase for full features (such as data export)
- privacy and permissions "may" be an issue, i prefer keeping the data private, controllable, accessible
- they can not be extended with certain features, reports, or tailored to individual needs
my solution is to simply use google sheets (private, fully accessible data, configurable, extensible, with sheet functions and there are more as you learn about it)
and add-ons or utilities for more convenient data entry
these utilities are based on app script to extend the functionality and automation to sheets
for newbies, here is a video introducing button and app script in 5 minutes
notes:
- to use the button on mobile devices, I recommend using a browser with desktop mode as a workaround, since buttons dont work on mobile app
- tip: on mobile chrome desktop mode, use double tap for zooming in or out, pinching doesn't work for me
check out the function add_rows_button_on_click()
in the code
(android-only, not possible in ios)
this utility is not yet user-friendly and fairly complicated to setup so it is mostly reserved for the tech-savvy to tackle
- notification data access is possible on only android via its API
- termux:api plugin wraps that API and provide a command (
termux-notification-list
) that output a list of visible notification in json - termux:api documentation does not have details about the command, but there was some discussions and the code can be seen here
the utility comprise of 2 components:
- one runs on the phone, using (termux + termux:api + curl command) to read visible notifications and post them to a web app
- another is the web app, using app script, receiving and processing notification data and inserting records into a sheet
- check out the code
later work can simplify termux*+curl into a simple app
- prepare a sheet, maybe clone my sheet
- set the web app up and running:
- clone the web app
- update the config:
- identify your money app's package name (with this guide)
- write and specify a notification parsing function specific for your money app
- run the
try_doPost()
function, by choosing that function in the dropdown menu and clicking "run" - allow permision via a popup
- debug and ensure that the function works well with your notifications
- deploy
- as a web app
- allow access to "anyone", so the phone termux can call it
- copy the deployment
URL
to use in a command later (note: keep the link private to yourself and that should be fine)
- setup the phone:
- install f-droid apk from f-droid.org (f-droid is like google play, but for open source apps)
- allow f-droid to install other apps' apk
- from f-droid install termux, termux:api, termux:widget
- allow termux:api to access notification
- (on an android-13 pixel device) i go to settings > notifications > privacy: device & app noti
- setup termux: open termux and run these commands:
pkg upgrade
pkg install termux-api
- test this COMMAND to send data to the web app and see if it works
termux-notification-list | curl -L --json @- URL
- create a shortcut script by running this command on termux:
echo 'COMMAND' > ~/.shortcuts/you_name_it.sh
- setup a termux widget that links to that shortcut script, namely:
you_name_it.sh
, allowing you to run the script with a touchh