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.0.0.tar.gz (14.7 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.0.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nutrition_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1a304028f3de5e92cd4052a91f23a57884a3a84e8591a88b4b1d7286868fd320
MD5 f5cf62e1f5b8bc0f7dee9f93936d4c8d
BLAKE2b-256 ce989b032f12126ed64fcd88019c43e36dc1e5c24950bde7005e18d03c2c9a32

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for nutrition_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6807151bb4691020d2eac0fc5be3766b3552918eb01607cf2ff0d7308b3e173
MD5 37f2e91972af225bf155973c65260b66
BLAKE2b-256 c4125bcd8d141f9f6ba121393bc93d962a7374a81d58b16e40954e27631ea7be

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