Round nutritional values for federal compliance.
Project description
round-nutrition
A lightweight Python package to round nutritional values for federal compliance with FDA and NDC guidelines.
Example
>>> a, b = Main(), Vitamin()
>>> print([a.tot_carb('0.8g'), b.vitamin_k('125.5 mcg')])
['less than 1 g', '126mcg']
>>> print(a.tot_carb('0.8 g', minimal=True))
'<1g'
Setup
First, install the package with:
$ pip install round-nutrition
Then, import the module with the desired nutrient(s):
from round_nutrition import Main # Vitamin, Mineral, Other
Usage
All subnutrient methods take in an integer
or string
argument of quantity
.
Main 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*
tot_carb*
tot_fat
tot_sugars*
trans_fat
*Some functions have an additional boolean
argument of minimal
that can be set to True
for a cleaner user interface implementation. By default, this parameter is set to False
.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
round-nutrition-1.0.8.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for round_nutrition-1.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ac10f5ecc1fc6b5787435636c2989e9612c40ae8729bb07612e32571aa4b866 |
|
MD5 | 27c0d02a0709e3fbcc4c3f4801864d38 |
|
BLAKE2b-256 | 37ca1f16756a647307f94489d764b4b54707742ba65be20fb22ec7ae56c9f4a5 |