Transactions is a tool to analyse data from MoneyDashboard (https://www.moneydashboard.com).
I found their app isn't great at exploring transaction data in depth, so I created my own api to add more filter and aggregation functionality.
- Display all transactions.
- Display a monthly breakdown of transactions by tag.
- Display monthly timeline of total in / out by tag.
- Add a budget and track spending by tag for the current month.
To install this application, clone the repo and follow these steps.
- Clone the repo
git clone https://github.com/TheIthorian/Transactions.git
- Make sure
python
andnode.js
are installed.
python --version
npm --version
- Install python dependencies:
It is optional, but recommended to install pipenv
, a python package manager which makes managing virtual environments easier.
If you chose not to install this, the corresponding commands can be found in src/Pipfile
.
On Windows, you'll need to add the following to your PATH environment variable and restart your PC:
- c:\users\<username>\appdata\roaming\python\python310\site-packages
- c:\users\<username>\appdata\roaming\python\python310\scripts
cd src
pip install --user pipenv
pipenv install
- Install node modules
cd web
npm install
- Rename the
config_example.json
file toconfig.json
. In the file, set your password:
"PASSWORD": "my_password"
Use this password when logging into your account.
- Start the python (flask) server
cd src
pipenv run serve
- Start the node server
cd web
npm run prod
This will start the app, but by default there are no transactions.
You can import import transactions either using the UI or with the CLI.
With UI
Go to the Upload Transactions
tab in the UI. Upload on or more csv files which contain the transactions and hit submit. This will save all new transactions to the database.
Below the upload field, there is a grid which shows all past upload attempts.
At the moment you cannot yet switch accounts or formats from this page. For that, you will need to use the CLI...
With CLI
To load transactions, go to https://www.moneydashboard.com and download all transactions to a csv file. Save this file to the root of the project directory and run pipenv run import
. This saves all the transactions to the persistent database.
import
can be run with the following arguments:
-f FILENAME, --filename FILENAME
Sets the filename of the transactions csv to import.
-s {moneydashboard,metro}, --source {moneydashboard,metro}
Sets the source of the transactions. Supported options depend automatically on which readers are registered in import.py.
-a ACCOUNT, --account ACCOUNT
Sets which account to use.
Using a different account creates a new database to store transactions. This is useful if you need to separate accounts.
No problem!
It is possible to define your own Reader
to map different csv formats:
- Make a new reader file in
src/app/importer/
- Define a function which returns a Reader instance
- Make sure to set the
source
,csv_headers
, andmapping
attributes source
: The name of the source. E.g.'metro bank'
csv_headers
: A list of each header in the source csv filemapping
: A function which takes in a csv row, and returns adict
containing the following values:- Account
- Date
- CurrentDescription
- OriginalDescription
- Amount
- L1Tag
- L2Tag
- L3Tag
- Make sure to set the
- In
src/app/importer/register.py
, add your new reader function to theregister
inregister_readers()
- See
src/importer/metro_reader.py
for an example on how to do this
You'll then be able to use this as a --source
argument value when running pipenv run import
.
This is where all the config for the application is stored. See below for an explanation of each property:
API_KEY
- All requests use this key to validate access to the api.REQUEST_ORIGIN
- List of allowed request origins. Use*
to allow all.HOST
- Which ip the backend server will be hosted on.PRINT_QUERIES
- Log each query for debugging.PASSWORD
- The password used to log in (for basic security).
Additional arguments can be passed to the dev
and serve
commands.
-d, --dev Runs in development mode
--demo Runs in demo mode which uses fake data
-a ACCOUNT, --account ACCOUNT
Sets which account to use
Using a different account creates a new database to store transactions. This is useful if you need to separate accounts.
The transaction list displays a detailed list of all transactions.
A breakdown of the total transaction amounts under each tag type. The tag level and specificity increases towards the center.
The total amount by tag across a monthly timeline.
In each data display component, it is possible to filter the results by date and tag (inclusive):
Distributed under the MIT License. See LICENSE
for more information.