dropwizard service providing access to USDA nutrient data
####Initialize Data
-
Download flat (*.TXT) files from USDA Nutrient Database
-
Build a jar of the project:
mvn package
- Run database migrations:
java -jar nutrientdata-x.x.x-SNAPSHOT.jar db migrate config.yml
- 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