Giter VIP home page Giter VIP logo

round-nutrition's Introduction

pre-commit.ci status PyPI Downloads

round-nutrition

A lightweight Python package to round nutritional values for federal compliance with FDA and NDC guidelines

>>> print([total_carb('0.8g'), vitamin_k('125.5 mcg')])
['less than 1g', '126mcg']
>>> print(total_carb('0.8 g', minimal=True))
<1g

Installation

Install the package:

pip install round-nutrition

Import the module:

from round_nutrition import * # or specific functions

Usage

All subnutrient functions take in an int or str argument for quantity

         General                   Vitamin                  Mineral                  Other
      added_sugars*           biotin                      calcium                   choline
      calories                folate                      chromium
      cholesterol*            niacin                      copper
      dietary_fiber*          pantothenic_acid            iodine
      insoluble_fiber*        riboflavin                  iron
      mono_fat                thiamine                    magnesium
      other_carb*             vitamin_a                   manganese
      poly_fat                vitamin_b12                 molybdenum
      potassium               vitamin_b6                  potassium
      protein*                vitamin_c                   phosphorus
      sat_fat                 vitamin_d                   selenium
      sodium                  vitamin_e                   zinc
      soluble_fiber*          vitamin_k
      sugar_alcohol*
      total_carb*
      total_fat
      total_sugars*
      trans_fat

โš ๏ธ As of 1.1.x all functions are global with no need for special imports

*Has a boolean parameter of minimal to opt for a cleaner UI

Sources

Contributing

Make a pull request for any idea/fix you have, or make an issue if you're lazy

License

MIT

round-nutrition's People

Contributors

hdadhich01 avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

round-nutrition's Issues

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.