Metadata-Version: 2.1
Name: round-nutrition
Version: 1.0.0
Summary: Round nutritional values for federal compliance.
Author: Harsh Dadhich
License: MIT License
        
        Copyright (c) 2022 Harsh Dadhich
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: homepage, https://github.com/hdadhich01/round-nutrition
Project-URL: repository, https://github.com/hdadhich01/round-nutrition
Keywords: fda,nutrition,round
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
License-File: LICENSE

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/hdadhich01/round-nutrition/main.svg)](https://results.pre-commit.ci/latest/github/hdadhich01/round-nutrition/main)
![build](https://github.com/hdadhich01/round-nutrition/actions/workflows/build.yml/badge.svg)
[![PyPI](https://img.shields.io/pypi/v/round-nutrition)](https://pypi.org/project/round-nutrition/)

# round-nutrition
A lightweight Python package to round nutritional values for federal compliance with [FDA](https://www.fda.gov/) and [NDC](https://www.usdairy.com/about-us/national-dairy-council) regulations.
## Example
```py
>>> 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:
```shell
$ pip install round-nutrition
```
Then, import the module with the desired nutrient(s):
```py
from round_nutrition import Main # Vitamin, Mineral, Other
```

## Usage
All subnutrient methods take in an `integer` or `string` argument of `quantity`.
```js
          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
[MIT](https://github.com/hdadhich01/round-nutrition/blob/main/LICENSE)
