Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Scripts for interacting with calories, to fuzzy select new entries to add, swap/merge databases

License

Notifications You must be signed in to change notification settings

seanbreckenridge/calories-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calories-fzf

Scripts for interacting with calories

These are up here incase anyone wants to try hacking on them, I don't expect to update/use these anymore as I've replaced this with ttally

calfzf

A fzf interface to , to add something you've eaten in the past again.

As you add more things to calories using calories add <cal> '<name>', this picks them up using calories export.

calswap

Swaps the current calories database (by updating your $GOBIN/.caloriesconf file) to another database. If the path doesn't exist, it copies the currently active database, along with all the data

calmerge

Note: creates a backup of your current database before modifying anything

Merges multiple 'calories' databases together.

Merges entries and weights from the current and any database(s) passed as arguments, removing duplicate entries. The resulting entries are imported into the currently active database, using 'calories import'

For food, a duplicate is determined by using the following:

(created, entryDate, calories, food)

i.e., ignoring the bmr/amr, since those may differ based on inconsistencies between weights on different databases

For weight duplicates are determined using:

(created, weight)

ids may change during the merge process

usage: calmerge [-h] [-d] CALORIES_DATABASE [CALORIES_DATABASE ...]

positional arguments:
  CALORIES_DATABASE  One or more calories databases to use as input

optional arguments:
  -h, --help         show this help message and exit
  -d, --debug        Increase log verbosity

Install

Dependencies: bash, python3.6+

You could install each of the scripts manually onto your $PATH, or use the Makefile, which attempts to install them into ~/.local/bin:

git clone https://github.com/seanbreckenridge/calories-scripts
cd ./calories-scripts
make

About

Scripts for interacting with calories, to fuzzy select new entries to add, swap/merge databases

Topics

Resources

License

Stars

Watchers

Forks