A tool to generate stats/charts from Daylio CSV exports.
Currently supports:
- Creating a chart of all data since the beginning of tracking
- Smoothing the chart with a rolling average
Locally you can use:
$ ./manage.py generate_charts <path to Daylio CSV>
to get more charts than we're able to generate now on Heroku.
After cloning the repo:
$ npm install(this is only for development currently)$ poetry install
Running from local MariaDB server, you'll need a database and a user, create them using this:
CREATE DATABASE dayliostats CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'dayliostats'@'localhost' IDENTIFIED BY 'dayliostats';
GRANT ALL PRIVILEGES ON dayliostats.* TO 'dayliostats'@'localhost';Either set the DS_SECRET_KEY env variable directly, or read the key from a file.
For bash:
$ export DS_SECRET_KEY=$(cat .ds_secret_key)For fish:
$ set -x DS_SECRET_KEY (cat .ds_secret_key)Or just create .env file and put it in there:
DS_SECRET_KEY=...
Same as with the secret key:
Either set the DS_DB_PASSWORD env variable directly, or read the key from a file.
For bash:
$ export DS_DB_PASSWORD=$(cat .ds_db_password)For fish:
$ set -x DS_DB_PASSWORD (cat .ds_db_password)Go to dayliostats/settings.py and set
DEBUG = True
ADMIN = TrueFor port 8000:
$ poetry shell
$ ./manage.py runserver 8000
$ gunicorn dayliostats.wsgi
$ docker run --rm -e DS_SECRET_KEY="<secret key>" -p 8000:8000 daylio-stats
$ ./manage.py test