Skip to content

aarontimbo/nutrientdata

Repository files navigation

nutrientdata

dropwizard service providing access to USDA nutrient data

####Initialize Data

  1. Download flat (*.TXT) files from USDA Nutrient Database

  2. Build a jar of the project:

mvn package
  1. Run database migrations:
java -jar nutrientdata-x.x.x-SNAPSHOT.jar db migrate config.yml
  1. Import each USDA flat file. Example (MySQL):
LOAD DATA INFILE '/path/to/FOOD_DES.txt'
 INTO TABLE food_description fields terminated by '^' enclosed by '~';

####File to table mapping

  • FD_GROUP.txt --> food_group

  • FOOD_DES.txt --> food_description

  • NUT_DATA.txt --> food_nutrient

  • NUTR_DEF.txt --> nutrient_definition

  • WEIGHT.txt --> food_weight

About

dropwizard service providing access to USDA nutrient data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages