-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts to extract food data from usda databases
- Loading branch information
Cody Weaver
authored and
Cody Weaver
committed
Jan 5, 2024
1 parent
2ba9ea1
commit bd41ea1
Showing
8 changed files
with
7,664 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Unproccessed USDA database files | ||
brandedFood.json | ||
foundationFoods.json | ||
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 25 additions & 3 deletions
28
app/src/main/java/com/android/pocketalchemy/model/Ingredient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
package com.android.pocketalchemy.model | ||
import com.google.firebase.firestore.DocumentId | ||
import com.google.firebase.firestore.IgnoreExtraProperties | ||
import androidx.annotation.Keep | ||
|
||
/* PLACEHOLDER */ | ||
/** | ||
* Ingredient Model class | ||
*/ | ||
@Keep | ||
@IgnoreExtraProperties | ||
data class Ingredient( | ||
val name: String = "", | ||
val ingredientId: Int = 0 | ||
@DocumentId val id: String? = null, | ||
val name: String? = null, | ||
val category: String? = null, | ||
val calories: MeasuredInt? = null, | ||
val protein: MeasuredInt? = null, | ||
val fat: MeasuredInt? = null, | ||
val carbs: MeasuredInt? = null, | ||
val sodium: MeasuredInt? = null, | ||
val fiber: MeasuredInt? = null,, | ||
val sugars: MeasuredInt? = null, | ||
val portions: list<MeasuredInt>? = null, | ||
val fdcId: String? = null | ||
) | ||
|
||
/** | ||
* TODO: extract possible units from ingredients and make enum | ||
*/ | ||
data class MeasuredInt(val value: Int, val unit: String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.