Skip to content

Import the SR26 USDA National Nutrient Database for Standard Reference into a Sqlite3 database.

Notifications You must be signed in to change notification settings

patrickgates/USDA-SR26-Ruby-SQlite3-Translater

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Import the USDA National Nutrient Database for Standard Reference into a Sqlite3 database. Tested on ruby 1.9.2.

Instructions

  1. Download and the ASCII version of the SR26 database from the Nutrient Data Laboratory Home Page. There is a 7.6 Mb ZIP file containing the entire database.

  2. Extract the database into this project's top-level directory. It will create a subdirectory called 'sr26' and should look like:

     sr26/Data_src.pdf
     sr26/DATA_SRC.txt
     sr26/DATSRCLN.txt
     sr26/DERIV_CD.txt
     sr26/FD_GROUP.txt
     sr26/FOOD_DES.txt
     sr26/FOOTNOTE.txt
     sr26/LANGDESC.txt
     sr26/LANGUAL.txt
     sr26/NUT_DATA.txt
     sr26/NUTR_DEF.txt
     sr26/sr26_doc.pdf
     sr26/SRC_CD.txt
     sr26/WEIGHT.txt
    
  3. Requires bundler. Run bundle install to install required gems if needed.

  4. Run rake load to create database and, optionally, rake pivot to create a flattened table with nutrient values (pivot task requires fts4 extensions to Sqlite).

About

Import the SR26 USDA National Nutrient Database for Standard Reference into a Sqlite3 database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%