Name | round-nutrition JSON |
Version |
1.1.1
JSON |
| download |
home_page | |
Summary | Round nutritional values for federal compliance |
upload_time | 2023-12-15 03:46:16 |
maintainer | |
docs_url | None |
author | |
requires_python | |
license | MIT |
keywords |
round
nutrition
fda
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![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)
[![PyPI](https://img.shields.io/pypi/v/round-nutrition)](https://pypi.org/project/round-nutrition/)
[![Downloads](https://pepy.tech/badge/round-nutrition)](https://pepy.tech/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) guidelines
```pycon
>>> 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:
```bash
pip install round-nutrition
```
Import the module:
```py
from round_nutrition import * # or specific functions
```
## Usage
All subnutrient functions take in an `int` or `str` argument for `quantity`
```js
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
- [Food and Drug Administration](https://www.fda.gov/files/food/published/Food-Labeling-Guide-%28PDF%29.pdf#page=129)
- [National Dairy Council](https://www.usdairy.com/getmedia/7f24626b-c08b-459a-b964-7a8478c88cd0/dmi%20quick%20reference%20guide_nutrition%20claims%20for%20dairy%20products_2018.pdf.pdf.aspx#page=10)
## Contributing
Make a pull request for any idea/fix you have, or make an issue if you're lazy
## License
[MIT](https://github.com/hdadhich01/round-nutrition/blob/main/LICENSE)
Raw data
{
"_id": null,
"home_page": "",
"name": "round-nutrition",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "round,nutrition,fda",
"author": "",
"author_email": "Harsh Dadhich <me@harshdadhich.com>",
"download_url": "https://files.pythonhosted.org/packages/ff/ee/fc0ec6107fac3a667e53549f857481887a3d81b1cfb659507b445dba4412/round-nutrition-1.1.1.tar.gz",
"platform": null,
"description": "[![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)\n[![PyPI](https://img.shields.io/pypi/v/round-nutrition)](https://pypi.org/project/round-nutrition/)\n[![Downloads](https://pepy.tech/badge/round-nutrition)](https://pepy.tech/project/round-nutrition)\n\n# round-nutrition\n\nA 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) guidelines\n\n```pycon\n>>> print([total_carb('0.8g'), vitamin_k('125.5 mcg')])\n['less than 1g', '126mcg']\n>>> print(total_carb('0.8 g', minimal=True))\n<1g\n```\n\n## Installation\n\nInstall the package:\n\n```bash\npip install round-nutrition\n```\n\nImport the module:\n\n```py\nfrom round_nutrition import * # or specific functions\n```\n\n## Usage\n\nAll subnutrient functions take in an `int` or `str` argument for `quantity`\n\n```js\n General Vitamin Mineral Other\n added_sugars* biotin calcium choline\n calories folate chromium\n cholesterol* niacin copper\n dietary_fiber* pantothenic_acid iodine\n insoluble_fiber* riboflavin iron\n mono_fat thiamine magnesium\n other_carb* vitamin_a manganese\n poly_fat vitamin_b12 molybdenum\n potassium vitamin_b6 potassium\n protein* vitamin_c phosphorus\n sat_fat vitamin_d selenium\n sodium vitamin_e zinc\n soluble_fiber* vitamin_k\n sugar_alcohol*\n total_carb*\n total_fat\n total_sugars*\n trans_fat\n```\n\n\u26a0\ufe0f As of `1.1.x` all functions are global with no need for special imports\n\n\\*Has a `boolean` parameter of `minimal` to opt for a cleaner UI\n\n## Sources\n\n- [Food and Drug Administration](https://www.fda.gov/files/food/published/Food-Labeling-Guide-%28PDF%29.pdf#page=129)\n- [National Dairy Council](https://www.usdairy.com/getmedia/7f24626b-c08b-459a-b964-7a8478c88cd0/dmi%20quick%20reference%20guide_nutrition%20claims%20for%20dairy%20products_2018.pdf.pdf.aspx#page=10)\n\n## Contributing\n\nMake a pull request for any idea/fix you have, or make an issue if you're lazy\n\n## License\n\n[MIT](https://github.com/hdadhich01/round-nutrition/blob/main/LICENSE)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Round nutritional values for federal compliance",
"version": "1.1.1",
"project_urls": {
"Source": "https://github.com/hdadhich01/round-nutrition"
},
"split_keywords": [
"round",
"nutrition",
"fda"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dbbce42468b480f427c0a5a3f50ae79ac3140516c25c4f94191a931ecef60bbe",
"md5": "f48b3498a2b4f2337881c1afca7e7536",
"sha256": "fa0b57e58ebaca8e7dc660b710b101c86f74c12e65319f49be24646d8726e35c"
},
"downloads": -1,
"filename": "round_nutrition-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f48b3498a2b4f2337881c1afca7e7536",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7251,
"upload_time": "2023-12-15T03:46:14",
"upload_time_iso_8601": "2023-12-15T03:46:14.921140Z",
"url": "https://files.pythonhosted.org/packages/db/bc/e42468b480f427c0a5a3f50ae79ac3140516c25c4f94191a931ecef60bbe/round_nutrition-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ffeefc0ec6107fac3a667e53549f857481887a3d81b1cfb659507b445dba4412",
"md5": "8bfc9f59c72e66fb3a4c9b6d2c4ba30d",
"sha256": "d239ad41552fbf1c0f06b1ea05f13a57bc6da06c694fa4d868a4a4362062f63d"
},
"downloads": -1,
"filename": "round-nutrition-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "8bfc9f59c72e66fb3a4c9b6d2c4ba30d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6669,
"upload_time": "2023-12-15T03:46:16",
"upload_time_iso_8601": "2023-12-15T03:46:16.689256Z",
"url": "https://files.pythonhosted.org/packages/ff/ee/fc0ec6107fac3a667e53549f857481887a3d81b1cfb659507b445dba4412/round-nutrition-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-15 03:46:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hdadhich01",
"github_project": "round-nutrition",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "round-nutrition"
}