{"id":37074701,"url":"https://github.com/hdadhich01/round-nutrition","last_synced_at":"2026-01-14T08:47:33.524Z","repository":{"id":43807988,"uuid":"511660865","full_name":"hdadhich01/round-nutrition","owner":"hdadhich01","description":"🐍 Lightweight Python package to round nutritional values for federal compliance","archived":false,"fork":false,"pushed_at":"2025-12-01T16:42:41.000Z","size":65,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-04T05:57:09.654Z","etag":null,"topics":["fda","nutrition","python","round"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/round-nutrition","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hdadhich01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-07-07T20:09:03.000Z","updated_at":"2024-09-26T00:36:43.000Z","dependencies_parsed_at":"2023-02-16T09:30:48.289Z","dependency_job_id":"fa029df6-7993-4416-836c-bfb529f74777","html_url":"https://github.com/hdadhich01/round-nutrition","commit_stats":{"total_commits":44,"total_committers":2,"mean_commits":22.0,"dds":"0.11363636363636365","last_synced_commit":"5f2076c8a6efa6e711c368429358675caa99998c"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/hdadhich01/round-nutrition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdadhich01%2Fround-nutrition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdadhich01%2Fround-nutrition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdadhich01%2Fround-nutrition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdadhich01%2Fround-nutrition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hdadhich01","download_url":"https://codeload.github.com/hdadhich01/round-nutrition/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hdadhich01%2Fround-nutrition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fda","nutrition","python","round"],"created_at":"2026-01-14T08:47:32.946Z","updated_at":"2026-01-14T08:47:33.515Z","avatar_url":"https://github.com/hdadhich01.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![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\u003e\u003e\u003e print([total_carb('0.8g'), vitamin_k('125.5 mcg')])\n['less than 1g', '126mcg']\n\u003e\u003e\u003e print(total_carb('0.8 g', minimal=True))\n\u003c1g\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⚠️ 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdadhich01%2Fround-nutrition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhdadhich01%2Fround-nutrition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhdadhich01%2Fround-nutrition/lists"}