• Stars
    star
    100
  • Rank 328,775 (Top 7 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Calories Tracker for the Commandline

calories

Build Status Go Report Card GoDoc

Screenshot

Calories is a commandline tool for tracking calories and weight using the Harris Benedict formula for calculating your BMR (Basal Metabolic Rate).

Features

Screenshot

  • Weight Timeline
  • Day / Week / Month Overview
  • Personalized Configuration
  • Metric & Imperial Support
  • JSON Import / Export
  • Optional JSON Output for all Commands
  • History

Installation

Using Go:

go get github.com/zupzup/calories

Or with the released Binaries for

  • OS X (32-bit, 64 bit)
  • Windows (32-bit, 64 bit)
  • Linux (32-bit, 64 bit)

Getting Started

When you start calories, it will ask you where to put the calories.db file, which will store all of your data.

Then, it asks you to create your configuration using

calories config --weight=0.0 --height=0.0 --activity=0.0 --birthday=01.01.1970 --gender=female --unit=metric

// Example Metric
calories config --weight=88.0 --height=189.0 --activity=1.375 --birthday=02.09.1986 --gender=male --unit=metric

// Example Imperial (with shorthand flags)
calories config --w=226.0 --h=72.8 --a=1.55 --b=02.09.1986 --g=male --u=imperial

Except for Activity, the parameters should be pretty self-explanatory. You can use both the metric or the imperial system, but you need to specify the one you are using in the configuration.

The Activity Setting depends on how much you exercise and needs to be set independently of the unit system based on this table:

Amount of Exercise Activity
Little to no exercise 1.2
Light exercise (1–3 days per week) 1.375
Moderate exercise (3–5 days per week) 1.55
Heavy exercise (6–7 days per week) 1.725
Very heavy exercise 1.9

After configuration you're all setup. Just typing calories will show you all entries of the current day.

You can add entries using e.g.: calories add 150 apple.

Usage

All commands follow the same structure:

calories [options] <commands> [<arguments...>]

You can use these commands to get an overview of all the different commands and information on how to use them:

calories -help

calories -commands

calories <command> -help

Adding an Entry

// Add an apple with 100 calories
calories add 100 Apple

// Add dates and cashews 
calories add 300 "dates and cashews"

// Add a Burger with 1000 calories 
calories add 1000 Burger

// Add an apple with 100 calories for a certain day
calories add --d=01.01.2017 100 Apple

Display Modes

// Show the current day
calories

// Show a certain day
calories --d=01.01.2017

// Show the current week
calories --w

// Show the current month
calories --m

// Show the last 30 days
calories --h=30

// Show the last 1000 days
calories --h=1000

Clearing all entries on a Day

The clear commands ask for your permission, before they actually delete anything.

// Clear the current day
calories clear

// Clear a specific day
calories clear --d=01.01.2017

Clearing a position inside an Entry

// Clear the position on the current day (1-n)
calories clear --p=1

// Clear the position on the current day (1-n)
calories clear --d=01.01.2017 --p=1

View Weight Timeline

// Show Weight Timeline
calories weight

Add Weight

// Add new weight on today's date
calories weight 85.0 

Configuration

If you set the configuration, after you already set it, the configuration is overwritten. However, you will get asked before this happens.

// Display the current configuration
calories config

// Example Metric
calories config --weight=88.0 --height=189.0 --activity=1.375 --birthday=02.09.1986 --gender=male --unit=metric

// Example Imperial (with shorthand flags)
calories config --w=226.0 --h=72.8 --a=1.55 --b=02.09.1986 --g=male --u=imperial

Export

// Export all Data to backup.json
calories export > backup.json

Import

Import does NOT ask your permission before overwriting data.

// Import all data from backup.json, OVERWRITING ALL DATA! 
calories import --f=backup.json 

JSON Output

All commands have a --o flag for JSON output, which makes it possible to easily integrate calories with other tools.

// Default is terminal
calories --o terminal

// And there is also JSON 
calories --o json

That's it - have fun! :)

Credit

Renee French, For the Go Gopher the Logo is based on

More Repositories

1

golang-http-file-upload-download

A simple example of an HTTP upload and download in Go
Go
177
star
2

warp-websockets-example

Basic example using websockets with warp in Rust
Rust
101
star
3

casbin-http-role-example

Example of role-based HTTP Authorization with casbin
Go
96
star
4

smart-contracts-with-go

A simple example of how to deploy and interact with ETH smart contracts using Go
Go
84
star
5

blog-generator

static blog generator for my blog at https://zupzup.org/
Go
83
star
6

rust-commandline-example

Example for building a command line application using Rust
Rust
80
star
7

rust-peer-to-peer-example

An example for building a simple peer to peer application using Rust
Rust
79
star
8

rust-blockchain-example

Simple example for building a blockchain in Rust
Rust
69
star
9

react-native-ethereum

Example code for creating an ETH wallet with react-native
Java
63
star
10

rust-fullstack-example

example of a full stack web app (backend and frontend) written in Rust
Rust
63
star
11

warp-postgres-example

An example for writing a simple CRUD Web app using Warp and tokio-postgres
Rust
61
star
12

rust-jwt-example

Example of JWT authentication and authorization in Rust using Warp
Rust
50
star
13

rust-epoll-example

Rust
44
star
14

solidity-example-crowdfunding

An example for an Ethereum Smart Contract with Solidity
HTML
38
star
15

reactgym

Workout-Tracking app built in ES6 using react, flux and ImmutableJS
JavaScript
37
star
16

warp-upload-download-example

Example of Upload and Download in Rust using Warp
Rust
33
star
17

static-aws-deploy

A tool for deploying files to an AWS S3 bucket with configurable headers and invalidating AWS Cloudfront Objects.
Go
28
star
18

woddle

An async, synchronized database-backed Rust job scheduler
Rust
28
star
19

rust-minimal-web-service-hyper

An example of a minimal web service in Rust using hyper
Rust
26
star
20

rust-frontend-example-yew

Example of using Yew to build a frontend application in Rust
Rust
26
star
21

rust-reactor-executor-example

Rust
22
star
22

rust-web-example

Simple rust web example using the timeular API and actix
Rust
22
star
23

boltdb-example

A simple example using BoltDB and Go
Go
20
star
24

example-go-graphql

Example of using Go to create a graphql API
Go
20
star
25

rust-docker-web

Example of packaging a Rust web application using Docker
Dockerfile
19
star
26

ast-manipulation-example

A simple example of manipulating the ast in Go
Go
19
star
27

rust-redis-web-example

Example of Using Redis in a Rust Web Application
Rust
18
star
28

rust-web-mongodb-example

An example using MongoDB in a Rust Web Service
Rust
17
star
29

rmq-in-rust-example

An example of using RabbitMQ in Rust
Rust
16
star
30

trpc-example

Example for using tRPC both on the server and on the client
TypeScript
16
star
31

markdown-code-highlight-go

example of highlighting code from a markdown source in pure go
Go
16
star
32

rust-frontend-example-iced

Example of building a frontend app in Rust using the iced.rs library
JavaScript
16
star
33

minions-tinder

Tinder-like swipe-interface for minions built with react
CSS
14
star
34

rust-ml-example

Basic example of using Rust for Machine Learning using Linfa
Rust
13
star
35

rust-web-e2e-testing

An example of integration and end2end testing of a rust microservice
Rust
12
star
36

rust-nom-parsing

Example for writing a simple parser using Nom and Rust
Rust
11
star
37

java8-functional-katas

Some katas for functional programming in Java 8 for a coding dojo.
Java
10
star
38

gitlab-push-and-mr

Rust CLI tool to push the current commits and create an MR in Gitlab
Rust
10
star
39

rust-web-configuration-example

An example of configuration management in a Rust web application
Rust
10
star
40

multi-stage-docker-react

A practical example of using Docker Multi-Stage builds with a React SPA
JavaScript
10
star
41

example-go-ical

Example of creating an ical endpoint based on data via REST using Go
Go
8
star
42

ml-in-go-examples

Examples for my Blog-Series on Machine Learning in Go
Go
8
star
43

java-0-deps-webapp

Java Web Application without any dependencies
Java
8
star
44

mobc-lapin

RabbitMQ support for the mobc connection pool
Rust
8
star
45

boltdb-storm-example

example for using boltdb with storm
Go
8
star
46

rust-web-prometheus-example

An example for using Prometheus Metrics in a Rust Web Service
Rust
8
star
47

blogchain-example-substrate

Example of a custom blockchain based on the Substrate Template Node
Rust
8
star
48

golang-io-pipe

Examples leveraging golang's io.Pipe
Go
8
star
49

xlsx-in-rust-example

Rust
7
star
50

kotlin-webflux-example

kotlin-webflux-example
Kotlin
6
star
51

rust-casbin-example

An example of using casbin within a rust web application
Rust
6
star
52

job-runner-example-rust

An example async job runner, which synchronizes via redis
Rust
6
star
53

algos-go

Introduction to Algorithms - GoLang implementations
Go
6
star
54

blog

Markdown source, resources and metadata for my blog at https://www.zupzup.org.
5
star
55

kotlin-example-websockets

Example of using Kotlin to create a WebSockets API
Kotlin
5
star
56

refinery-warp-example

An example showing DB migrations in a web app with refinery and warp
Rust
5
star
57

rust-async-web-example

Asyncified Actix 1.0 Web App Example using Rust
Rust
5
star
58

rust-templating-example

An example for Template rendering using Rust
Rust
4
star
59

example-rust-json-input-validation

Example of doing JSON input validation in a rust web service
Rust
4
star
60

rust-e2e-encryption-example

Basic example implementing e2e encryption in Rust
Rust
4
star
61

eth-prepaid-transaction

Full Example for sending eth to a client for signing a contract
Go
4
star
62

markdown-code-highlight-chroma

example of highlighting code from a markdown source in pure go with chroma
Go
4
star
63

dotfiles-linux

my dotfiles on ubuntu linux
Shell
3
star
64

rust-gdb-example

Example code for debugging Rust programs using GDB
Rust
3
star
65

rust-profiling-example

Example for profiling a rust web app
Rust
3
star
66

rust-crossbeam-example

Example for using the Crossbeam library in Rust
Rust
2
star
67

blockchainhub-solidity-dojo

Base for the BlockchainHub Graz Solidity Dojo
HTML
2
star
68

rust-capnproto-example

Example using Rust and Capnproto
Rust
2
star
69

rust-swc-webpack-plugin

Example of writing a custom webpack plugin in Rust using SWC
Rust
1
star
70

kotlin-scrollingdemo

Demo of a scrolling endpoint for fetching huge amounts of data in an efficient way
Kotlin
1
star
71

async-explorations

some exploration using async and futures
Rust
1
star
72

blogchain-frontend-example-substrate

frontend for the blogchain substrate example
JavaScript
1
star
73

substrate-kitties-example

Repo for the Substrate Kitties Example (https://docs.substrate.io/tutorials/v3/kitties/)
Rust
1
star
74

axum-example

Simple example using axum
Rust
1
star
75

frp-talk-examples

Examples for a talk on Functional Reactive Programming with RxJS
JavaScript
1
star
76

bevy-example

Example game with bevy
Rust
1
star
77

timeular-webhooks-example

An example showing off Timeular Webhooks in Rust
Rust
1
star
78

phil-blog-generator

static blog generator for my blog at https://philozuphy.com/
Go
1
star
79

rust-ai-chatbot-ollama

Example for building a simple AI chatbot with a locally running LLM using Rust and ollama.ai
Rust
1
star
80

winka

Playing around with windows in Rust.
Rust
1
star