Skip to main content

CLI tool for nutrition data lookup from USDA and Open Food Facts

Project description

nutrition-cli

CLI tool for nutrition data lookup, powered by USDA FoodData Central and Open Food Facts. Also ships as an OpenClaw skill for AI-assisted nutrition queries.

Install

Via ClawHub (recommended for OpenClaw users)

claw install nutrition-cli

This installs both the CLI tool and the OpenClaw skill that lets your agent answer nutrition questions automatically.

Via pip

pip install nutrition-cli

Quick start

# Look up a food
nutrition search "chicken breast" --grams 200

# Scan a barcode
nutrition barcode 3017624010701

# Compare foods
nutrition compare "white rice" "brown rice" "quinoa"

# Calculate a meal
nutrition meal "200g chicken breast" "150g rice" "1 avocado" --rda

# Calories burned
nutrition burn running 30 --weight 70

# Daily targets
nutrition daily --sex female --age 25 --weight 60 --activity moderate

Commands

Command Description
nutrition search QUERY Look up nutrition for any food
nutrition barcode CODE Look up by barcode (EAN-8/13, UPC-A)
nutrition compare FOOD1 FOOD2 ... Side-by-side comparison (2-5 foods)
nutrition meal "Xg food" ... Sum nutrition across a meal
nutrition burn ACTIVITY MINUTES Estimate calories burned
nutrition daily Personalized daily intake targets
nutrition config set Set API key or defaults

All commands support --format json for machine-readable output and --grams for custom serving sizes.

Rate limits

No API key is required. The tool uses USDA's DEMO_KEY (50 requests/day per IP) and Open Food Facts (unlimited, no key needed).

If you hit the USDA rate limit, get a free personal key in 30 seconds:

  1. Sign up at https://fdc.nal.usda.gov/api-key-signup
  2. Run: nutrition config set --usda-key YOUR_KEY

This raises your limit to 1,000 requests/hour.

Data sources

  • USDA FoodData Central — generic foods (SR Legacy, Foundation) and branded products. US government data, high quality.
  • Open Food Facts — community-contributed product database with barcode lookup, Nutri-Score, NOVA classification, allergen data, and vegan/vegetarian status.

The CLI prefers USDA SR Legacy/Foundation results for generic food queries and falls back to Open Food Facts automatically.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nutrition_cli-1.1.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nutrition_cli-1.1.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file nutrition_cli-1.1.0.tar.gz.

File metadata

  • Download URL: nutrition_cli-1.1.0.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for nutrition_cli-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7e8fe3f360e3dc1d2b503a66c3af63379159765b1a88f667d2bba177511c3a91
MD5 7ecb42feca92bcfc7760b88744f8a409
BLAKE2b-256 cf3e2124c5a9c0f422a7683c5e725adfbbf74ded5b791423a5707a5606c7441f

See more details on using hashes here.

File details

Details for the file nutrition_cli-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: nutrition_cli-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for nutrition_cli-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d71435190c47a6fc76f2aacc861e57c9466bc2edc824e8518dbbba84ae20cdbb
MD5 f33a189f99b24bf870a14c1188b53336
BLAKE2b-256 caaf0d7313a5c4c7760daeac6fbfea3920cffee8a6dd6de1231d1e0e5fc0ecb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page