Git Product home page Git Product logo

nutrition's Introduction

Nut

A CSV-driven, locally hosted, nutrition repository and macronutrient calculator for the terminal.

Scope

This software is intended for people who only need to keep track of a handful of food items, portion their food by some universal standard portion (for me it's 100 grams), only care about macronutrients and calorie counts, and don't want to be bogged down by menus.

build

You'll need to install leiningen

sudo apt install leiningen

lein uberjar to build

lein run <params> to test

use

set an environment variable NUT to point to a path to store the csv and config files set up a blank csv file and make a config file with the line standard-portion val where val is your standard portion

nut <food> <grams> -> All values in-line

nut pretty <food> <serving> -> A prettier print

nut add <name> <kcal> <protein> <fat> <carbs> -> entry added to csv

Design Choices

I chose clojure as a challenge to work with a new language while also keeping the portability of the program. The JVM is ubiquitous. I may as well leverage it.

nutrition's People

Contributors

zacharylott94 avatar

Watchers

 avatar

nutrition's Issues

A way to remove foods

The syntax could be nut remove foodName
Currently, a user has to manually remove a food from their CSV

A way to list portion sizes

This is mostly for the user to know what nut will expect as a portion size. It currently expects all portion sizes to be 100 grams (this is hardcoded, and will be made to be more portion agnostic. Nobody wants to weigh out a bagel just to enter its weight in nut when the label tells you that a serving is one bagel).

Serving Size Agnosticism

Currently, nut expects all serving sizes entered into the CSV to be 100g. It's hardcoded to divide whatever serving you give it by 100 because it expects the user to use grams. I've worked around this for certain foods where I know a serving by count (a bagel, for example) by entering the food as 100x its nutritional value so that I can use a simple count. Example: nut bagel 1 will give me the macros for a single bagel in my food list because I entered the bagel as having 100 times its macros.

It'd be better if serving sizes were agnostic to where the user doesn't have to participate in shenanigans like above. Perhaps a serving multiplier could be added as a field? Perhaps also there could be a field for human readable serving units? Example: nut add milk 293 15.71 15.86 22.06 16 floz; name,kcal,protein,fat,carb,unitbasis,unitname

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.