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.8 g'), b.vitamin_k('125.5mcg')])
['less than 1 g', '126 mcg']
>>> print(a.tot_carb('0.8 g', minimal=True))
'<1 g'
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file round-nutrition-1.0.7.tar.gz.
File metadata
- Download URL: round-nutrition-1.0.7.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
684102bb411ca9ec0f8591fab8acfcb3b17376a7d81c85579a7ddf75912d3567
|
|
| MD5 |
5b290247745319b090f65d55762119ca
|
|
| BLAKE2b-256 |
3ce30865cbac2ffd5ce44f1620aeed7b681d776b839386d343e46108dd585f9f
|
File details
Details for the file round_nutrition-1.0.7-py3-none-any.whl.
File metadata
- Download URL: round_nutrition-1.0.7-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08b3acad71d85656f30bd83141008b3eaf9ba6926144932977cbacdcea8ae36c
|
|
| MD5 |
6406f29f2f7dc07e411a93b25bab8f5c
|
|
| BLAKE2b-256 |
0d3388edc03b743ae61039c6b9bce35ea82c6d05dd8d6c0dbc3d39b3b2a811a9
|