Personal Analytics Dashboard using Metabase and Nomie
I love personal analytics. Ever since I have started logging using Nomie, I have experimented with data, mostly using spreadsheet. It’s interesting to find patterns and make corrections. Nomie uses CouchDB as the cloud storage. CouchDB is a great database but I prefer a simple RDBMS when I want to query. So sometime back I wrote a Python script to download the data every night from CouchDB to SQLite database. Then I would use that database to run my queries. Overtime I have had a set of queries. I wanted a dashboard.
To start with we need to set up our daily batch download the data from CouchDB to SQLite. The script is on Github and its part of a project called OpenNowMeAPI. Start with downloading or cloning that project.
Download and Run OpenNowMeAPI
#Clone the project git clone https://github.com/thejeshgn/OpenNowMeAPI/ #intall dependencies pip install -r requirements.txt #Edit config/nowme_config.json and add auth and couch db details #Run the pull data script, you can also schedule it python batch_pull_data.py
It pulls the data from CouchDB and populates `config\report.sqlite’ Table names depend on the `couchdb_username’ like in Nomie couchdb setup. You can use DB Browser for SQLite to explore the data.
Dashboard – Metabase
There are many FOSS dashboard software available. freeboard, Grafana and Redash are all very well-known. I looked at each one of them. They all offer great features but all need some setup. Freeboard is probably the simplest to set up among them but then it lacks features. Then I found out Metabase. I really love the simplicity of it. It’s easy to set up and run. It comes with great features built-in except it doesn’t have a way to pull data from a JSON source, which freeboard has1. I hope Metabase will have that feature at some point.
Download and Run Metabase
#install Java and then run java -jar metabase.jar
It will take a couple of seconds to start and then will start a local server at port 3000. Go to http://localhost:3000 to access it.
Metabase initial settings
Setup an admin account. Then go to settings and setup timezone etc
Add our Nomie SQLite to using add database. Once added you can run queries on it.
Metabase Add Questions and Metrics
A dashboard item is called a question. You can add questions by suing SQL query or a metric. I used SQL query.
Once you create a question, you can add it to a dashboard. You can also have multiple dashboards.
Dashboards for personal life
An example Coffee Dashboard, shows total coffee, graph and map of the coffees I have had recently.
I am planning to create multiple dashboards around my finance and work. I will blog about them next. What do you think? Find dashboards interesting and useful in personal life?
- Still experimenting with it. Will report later :) ↩