src/shaving_log | ||
.gitignore | ||
LICENSE | ||
pdm.lock | ||
pyproject.toml | ||
README.md |
shaving-log
A TUI ("text user interface", ie. terminal) application for keeping track of (wet) shaving gear, and individual shaves.
Lovely looks provided by textual python library.
All data is kept locally in a single file (a sqlite3 database).
The data can be exported into an Excel spreadsheet (using --generate_spreadsheet FILENAME
command-line argument). It does not look good, but all the data is there. Also, it is only a one-way street, export to Excel.
Files and directories
By default, the app will attempt to use the file shaving-log/shaving-log.db
in the user data directory as the main sqlite3 database with all the data. So if you want to back up your data, back up this file. The location of the user data directory depends on the system; so altogether the database is in:
- linux:
$HOME/.local/share/shaving-log/shaving-log.db
- mac:
/Users/USERNAME/Library/Application Support/shaving-log/shaving-log.db
- windows:
C:\Users\USERNAME\AppData\Local\shaving-log\shaving-log.db
If this file (or path) does not exist, it will be created when the app starts, with a blank database initialised.
It is possible to change the directory and the filename passing command-line arguments (--db_directory
and --db_file
) to the app.
Finally, it is also possible that set the above arguments by providing a configuration file, with contents like this:
db_directory="$HOME/nextcloud/shaving"
db_file="shaving-log.db"
Either pass the path to this file as a command-line argument --config
, or name it config
and place it at the appropriate place:
- linux:
$HOME/.config/shaving-log/config
- mac:
/Users/USERNAME/Library/Application Support/shaving-log/config
- windows:
C:\Users\USERNAME\AppData\Local\shaving-log\config
Shaving Buddy android app compatibility
The database format this app uses is compatible with the Shaving Buddy app on android. You can use export/import functionality in the app to export/import the database, the corresponding file for this app is the aforementioned shaving-log.db
.
TODO
immediate / bugs
longer term
- add extra info to tables, e.g. uses
- statistics...
Miscellaneous leftovers/technicalities
mechanics of deleting shaves and gear
Note that neither shaves, nor gear, is ever actually deleted from the database - it is kept there, just marked as "deleted". For gear this is essential, since some shaves may already reference that gear, and we need to retain the info (brand, name, etc) about that gear.
For the moment there is no interface within the app to "undelete", one needs to edit the database directly.
Shaving Buddy (android app) sqlite database schema
CREATE TABLE android_metadata (locale TEXT);
CREATE TABLE shavingobjects ( _id integer primary key autoincrement, type integer not null, brand text not null, name text not null, shortname text not null, comment text, add1 integer, add2 integer, add3 integer, datetime integer not null, isdeleted integer not null default 0 );
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE shaves ( _id integer primary key autoincrement, razor integer not null, brush integer, blade integer, lather integer, aftershave integer, addcare integer, preshave integer, rating integer, comment text, datetime integer not null, isdeleted integer not null default 0, addcarebundle text, newblade integer, sharelink text );
License
MIT (see LICENSE file)