Giter Club home page Giter Club logo

tdee's Introduction

tdee

tdee is a simple command line tool to calculate your total daily energy expenditure.

Requirements

Install

The latest version of bfm can be installed using go get.

go get -u github.com/LGUG2Z/tdee

Make sure $GOPATH is set correctly that and that $GOPATH/bin is in your $PATH.

The tdee executable will be installed under the $GOPATH/bin directory.

Overview

tdee calculates your total daily energy expenditure by averaging the basal metabolic rate estimates given by three of the most commonly used formulas: Mifflin-St. Jeor, the original Harris-Benedict formula and the revised Harris-Benedict formula.

The raw output of this tool is designed to be piped to gainit and loseit to calculate a surplus for bulking or a deficit for cutting.

Usage

Certain information is required for this tool to be able to calculate an estimate of your total daily energy expenditure: height, weight, age, sex and a lifestyle modifier. Height and weight can be given in either cm/kg or ft/lb by using either the --metric or --imperial flags. The --height, --weight, --age and --sex flags are used to input the required information.

Valid lifestyle modifiers are:

1.2   : Sedentary
1.375 : Lightly Active
1.55  : Moderately Active
1.7   : Very Active
1.9   : Extremely Active

Valid sex options are:

male
female

Examples

Basic use:

❯ tdee --metric \
       --height 172 \
       --weight 63.7 \
       --age 29 \
       --sex male \
       --lifestyle 1.375
       
2191 kcal

Raw numerical output:

❯ tdee --metric \
       --height 172 \
       --weight 63.7 \
       --age 29 \
       --sex male \
       --lifestyle 1.375 \
       --raw
       
2191

Raw numerical output piped to gainit

❯ tdee --metric \
       --height 172 \
       --weight 63.7 \
       --age 29 \
       --sex male \
       --lifestyle 1.375 \
       --raw \
       | xargs gainit --gain 0.5 --kg
       
2741 kcal

Raw numerical output piped to loseit

❯ tdee --metric \
       --height 172 \
       --weight 63.7 \
       --age 29 \
       --sex male \
       --lifestyle 1.375 \
       --raw \
       | xargs loseit --lose 0.4 --kg
       
1751 kcal

Scripting

Given that weight is the only variable that is likely to change regularly, these tools can be scripted in order to be less verbose:

# Add this function to your shell rc
gain() {
  tdee --metric \
    --height 172 \
    --weight $1 \
    --age 29 \
    --sex male \
    --lifestyle 1.375 \
    --raw \
    | xargs gainit --gain 0.3 --kg
}

# Use it
❯ gain 63.7

2521 kcal
# Add this function to your shell rc
shred() {
  tdee --metric \
    --height 172 \
    --weight $1 \
    --age 29 \
    --sex male \
    --lifestyle 1.375 \
    --raw \
    | xargs loseit --lose 0.5 --kg
}

# Use it
❯ shred 70.6

1758 kcal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.