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
Metadata
Release files for round-nutrition 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| round-nutrition-1.1.1.tar.gz | 6.7 kB | Without provenance | Details for round-nutrition-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| round_nutrition-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for round_nutrition-1.1.1-py3-none-any.whl |
Total release size: 13.9 kB
Release files / round-nutrition-1.1.1.tar.gz
| Download URL | round-nutrition-1.1.1.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d239ad41552fbf1c0f06b1ea05f13a57bc6da06c694fa4d868a4a4362062f63d
|
|
BLAKE2b-256 checksum How to use checksums |
ffeefc0ec6107fac3a667e53549f857481887a3d81b1cfb659507b445dba4412
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / round_nutrition-1.1.1-py3-none-any.whl
| Download URL | round_nutrition-1.1.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa0b57e58ebaca8e7dc660b710b101c86f74c12e65319f49be24646d8726e35c
|
|
BLAKE2b-256 checksum How to use checksums |
dbbce42468b480f427c0a5a3f50ae79ac3140516c25c4f94191a931ecef60bbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for round-nutrition 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.