Skip to content

Commit

Permalink
Merge pull request #1 from timkolloch/features/update-readme
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
timkolloch authored Jul 27, 2024
2 parents e8e2add + 1110338 commit 3fa783b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ Tandoor has the possibility to add `Foods` which then can be used in recipes. Fo
These will be used to calculate the total nutrients of a recipe.
Because adding all the properties to a food by hand is quite annoying I built this importer to import data provided by the [USDA Food Database](https://fdc.nal.usda.gov/fdc-app.html#/food-search?query=&type=Foundation) using the [API](https://fdc.nal.usda.gov/api-spec/fdc_api.html).

## Important
- Note that all properties previously attached to a food are overwritten.

## How does it work?
1. The program reads the [appsettings.json](./appsettings.template.json) to find the Tandoor instance and to get the needed API-Keys for Tandoor and the USDA FDC database.
2. After that all properties and all foods are retrieved from the Tandoor instance.
3. For each food item retrieved from Tandoor the FDC ID of that food item (retrieved from the URL of the `Food`) is used to query the FDC database for nutrients.
4. All nutrients of a food item are retrieved, then the nutrients that are not present in Tandoor are filtered out.
5. The data retrieved from the FDC database is added to the Tandoor food. Note that all properties previously associated with the Tandoor food are overwritten.
5. The data retrieved from the FDC database is added to the Tandoor food. **Note that all properties previously associated with the Tandoor food are overwritten.**
6. The updated food is pushed to the Tandoor database.

## Prerequisites
Expand Down

0 comments on commit 3fa783b

Please sign in to comment.