Habits to Spreadsheet
Simple Go application that imports habits recorded by the Loop Habit Tracker into a Google Spreadsheet.
Show off code
I'm using this project to show "how do I code in Go", for whoever may be interested.
Interesting stuff:
- Hexagonal architecture with SOLID principles
- Unit tests (example)
- Separation of concerns
- Simple Makefile
- Example of GIT usage (commit size, signed commits, lah-dih-dah)
- Minimal dependencies
- TODO.md driven development
- Proper MIT license
More about me and some of my interests
Build
git clone https://github.com/jan-carreras/habits-to-spreadsheet
cd habits-to-spreadsheet
make
You will find a binary in bin/hsync
Usage
The aim is to import a Habits backup into Google Spreadsheets. Let's start by creating a backup from the Habits app and store it to the Drive. Leave the default name.
bin/hsync -spreadsheet "2021 - OKRs"
The spreadsheet must exist. A new Sheet called "Import" will be created with your habits, and it's count. The habits are filtered by default by quarter. Use help to modify that or any other option:
bin/hsync -h
Usage of bin/hsync:
-auth
authorize
-credentials string
credentials file (default "credentials.json")
-from string
yyyy-mm-dd date from where start importing Habits records
-prefix string
prefix of the backup name (default "Loop Habits Backup")
-quarter int
date range for the quarter of the current year
-sheet-name string
the name of the Sheet where data is going to be imported (default "Import")
-spreadsheet string
name of the spreadsheet to import
-tmp string
temporary directory where to store the DB (default "/tmp")
-to string
yyy-mm-dd date from where stop importing Habits records
-token string
token file (default "auth.json")
Contributing
Since the code is to show off, and I can hardly imagine anyone using it let alone contributing to the project, I don't see much value in accepting PRs. But feel free to create issues to highlight problems or requesting new features.