Inspiration
idea: to generate a metric to analyze and produce results for a consumer's grocery list and provide suggestions to improve
their "sustainability" score
general pipeline of how we made it
step 1: generate file that contains a brands and keywords about sustainability to use a a metric for generating a score
step 2: create a file that takes in a file input of a grocery list and extracts the column of products and converts it into
an indexable list
step 3: main function that uses conditionals and compares with the dictionary to generate a score for the product and then sums
to get a final sustainability score
if brand is not in database- create an error message that indicates that
step 4: create a list of suggestions to improve the sustainability based on the score and specific brands
step 5: create some interface using HTML
2024 Hack the Heights Hackathon Project (Sara Rigatti, Audrey Xiao, Elizabeth Garson)
We generated and created a metric to analyze and produce results for a consumer's grocery list and provide suggestions to improve their "sustainability" score. This score is generated by comparing a dictionary of brand names to those listed in a grocery list. Each brand name has a corresponding sustainability score which is determined out of ten, (ten meaning the best for sustainability and one meaning the worst.) In addition to giving a score, the program gives suggestions to specific brand names that have the lowest sustainability code.
The file Hack_the_Heights.ipynb contains all the functions in the program.
There are two txt files: 1. brands.txt and 2. groceries.txt
groceries.txt contains an example grocery list that the user uploads which lists the brands separated by the price of the item. brands.txt contains the entire list of brands which have sustainability scores which we use to check against the brands of the grocery lists. There is also a folder that includes information and requirements to set up flask and a web interface for the program. The flask code requires you to run main.py on terminal via python main.py in your project directory and use the link: http://127.0.0.1:8080/ to run the program.
Log in or sign up for Devpost to join the conversation.