Skip to content

arienshibani/green-bite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Green Bite API 🌱

Green Bite attempts to calculate sustainability scores for food. Sometimes it even works! πŸ€·β€β™‚οΈ

Masters thesis

Part of my masters thesis: Ingredient matching to determine the sustainability of online recipes. (Information Science, UiB: 2022).

How are sustainability scores calculated? πŸ’‘

Using this formula (amount_kg * land_usage) + (amount_kg * greenhouse_gas_emissions) = sustainability_score

Based on what data? πŸ€“

  • The SHARP database. Environmental impacts of 40,000 foods commonly eaten in 40 countries.
  • Simple weight tables to convert between volumetric and mass measurements.
  • Alot of assumptions and simplifications. Take the results with a shovel of salt. πŸ§‚

Quickstart

  • Make sure you have Docker installed and that it is running.
  1. ✨ Clone repo git clone [email protected]:arienshibani/green-bite.git

  2. πŸ—οΈ Navigate into repo and build the image docker build .

  3. πŸ‹ Run container docker run -p 80:80 green-bite

Open API specification should now be available locally! πŸ‘‰ http://0.0.0.0/docs

Example Usage

image

GET http://0.0.0.0/parse/ingredient/1%20kg%20of%20bacon

Response πŸ‘‡

{
 "inputIngredientString": "1 kg of bacon",
 "ingredientMatched": "bacon",
 "sustainabilityScore": 26.05213129,
 "details": {
  "quantity": 1,
  "measurement": "kg",
  "description": "bacon"
  }
}

About

🌱 Calculate food sustainability

Resources

Stars

Watchers

Forks

Packages

No packages published