Git Product home page Git Product logo

grocery-saver's Introduction

Grocery Saver

Author: Rui Li

Semester: Fall 2020

Contact Information: [email protected]

Overview of Project

With this project, I intend to build a price comparison program for grocery shopping. User can upload a grocery list to this program. The program takes the grocery list then search on the website of a few major local grocery stores (Walmart, Kroger, Meijer, Audi, Giant Eagle, etc.) to get the price and unit price, then provides a price comparison ( both for total price, and total unit price) for the uploaded grocery list. Users can select all grocery store, all pick some to compare. Users can also switch the comparison between total price or unit price. Basing on the user selection, the program will suggest the user which store to shop for the items on the grocery list.

Instruction

• Go to terminal and navigate to the GrocerySaver folder

• Type in python GrocerySaver.py to launch the program

ScreenShot

• Type in Grocery items

• Select at least a store (or multiple stores)

• Select the saving option: by total price or by unit price

• Click on the “Compare Price” button

• The Price Comparison window will pop up and display suggestion

ScreenShot

Reflection

This project is working as designed as the proposal. Using tkinter for UI, sqlite for database and requests for API calls. Main functions • The Grocery Saver UI takes the grocery lists entered by the user and save the grocery list to a csv file for later use • The Grocery Saver UI takes the store selections made by the user and save the store list to csv files for later use • User input validation – if the grocery list is empty or store is not selected, notification window will pop up • By Total Price and By Unit Price option on UI is for user to pick the price saving model • Once clicking “Compare Price” button, the program will loop through each store and check price of each item on the shopping list. • Check price function supports both checking price from the SQLite database or checking from the store API Main challenges

  1. It was not easy to get the API working. I’ve got Kroger API working and successfully call Kroger API to retrieve grocery item information. Not all grocery stores have API available. Some stores (like Walmart) have API, however, it doesn’t allow new application to register for API due to holiday season.

I overcame this problem by switching gear to load grocery price by store to SQLite database. I developed the databases and the SQLite connections to retrieve grocery item information.

Also, I stored the indicator whether a store has API, and check DB price or API price basing on if store API is available. This is for ease and flexibility of API extension in the future . If the store API is available in the future, I can easily extend and switch the API on.

  1. Get the repr to display in a nice format was also challenging. It took me a while to display the estimated receipt in aligned columns. I overcame the issue by using .ljust(length, “-“), so the columns are all in the same length and left aligned.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.