- Go 92.8%
- Makefile 7.2%
Nutrition Data
In my quest to make a meal planning program, one of the biggest obstacles has proven to be gathering the necessary data and rendering it useful. This repository holds some of the artifacts of that effort.
Each subdirectory has its own makefile for retrieving nutrition data and putting it into an SQLite database. Most of them also have their own READMEs describing the data and the rationale behind including it.
The SQLite code generated by the Go module in the db subdirectory pulls from the databases compiled in the other subdirectories to create the SQLite database meant to be used with the other parts of the project. If there is a primary "deliverable" here, it's the resulting nutrition.db file. It must be built last due to its dependency on the other databases.
Because of the large number of columns involved, main.go in the db subdirectory dynamically renders the contents of nutrition.sql from the columns maps in constants.go. The nutrition.sql file should not need to be rebuilt unless you want to change some aspect of nutrition.db's schema or the process by which it imports data from the USDA databases generated in the usda-* subdirectories.
The makefile in the current directory does not build the databases in the subdirectories. It only builds README.md and README.gmi from the README.lml source file.