Skip to content

Download, build, and query the USDA food database

License

Notifications You must be signed in to change notification settings

mfdeux/fooddata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fooddata

Download, build, and query the USDA food database.

Do you know what you are putting in your body?

Installation

$ pip install fooddata --upgrade

Usage

$ fooddata build
$ fooddata query "SELECT * from foods WHERE category_id IS NOT NULL LIMIT 100;" --json | jq .
$ fooddata query "SELECT * from foods WHERE category_id IS NOT NULL LIMIT 100;" --json > output2.json
$ fooddata query "SELECT * from food_nutrients_v WHERE food_type IS NOT NULL AND food_category IS NOT NULL LIMIT 1000;" --json | jq .

Update Database

To update the database, just run the first command again:

$ fooddata build

Note

The data comes from the USDA website: https://fdc.nal.usda.gov/download-datasets.html

About

Download, build, and query the USDA food database

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages