API Docs¶
-
nutritionparser.reader.
reader
(filepath, fields=None)[source]¶ Read CSV files from USDA National Nutrient Database.
Parameters: - filepath – Path to a USDA data file.
- fields – Fields in data file. Default:
None
(i.e use SR27 field names).
-
nutritionparser.reader.
sr27fields
= {'SRC_CD.txt': ['Src_Cd', 'SrcCd_Desc'], 'FOOD_DES.txt': ['NDB_No', 'FdGrp_Cd', 'Long_Desc', 'Shrt_Desc', 'ComName', 'ManufacName', 'Survey', 'Ref_desc', 'Refuse', 'SciName', 'N_Factor', 'Pro_Factor', 'Fat_Factor', 'CHO_Factor'], 'WEIGHT.txt': ['NDB_No', 'Seq', 'Amount', 'Msre_Desc', 'Gm_Wgt', 'Num_Data_Pts', 'Std_Dev'], 'DERIV_CD.txt': ['Deriv_Cd', 'Deriv_Desc'], 'NUTR_DEF.txt': ['Nutr_No', 'Units', 'Tagname', 'NutrDesc', 'Num_Dec', 'SR_Order'], 'LANGUAL.txt': ['NDB_No', 'Factor_Code'], 'NUT_DATA.txt': ['NDB_No', 'Nutr_No', 'Nutr_Val', 'Num_Data_Pts', 'Std_Error', 'Src_Cd', 'Deriv_Cd', 'Ref_NDB_No', 'Add_Nutr_Mark', 'Num_Studies', 'Min', 'Max', 'DF', 'Low_EB', 'Up_EB', 'Stat_cmt', 'AddMod_Date', 'CC'], 'FOOTNOTE.txt': ['NDB_No', 'Footnt_No', 'Footnt_Typ', 'Nutr_No', 'Footnt_Txt'], 'LANGDESC.txt': ['Factor_Code', 'Description'], 'DATA_SRC.txt': ['DataSrc_ID', 'Authors', 'Title', 'Year', 'Journal', 'Vol_City', 'Issue_State', 'Start_Page', 'End_Page'], 'DATSRCLN.txt': ['NDB_No', 'Nutr_No', 'DataSrc_ID'], 'FD_GROUP.txt': ['FdGrp_Cd', 'FdGrp_Desc']}¶ SR27 field names.