miniproject
miniproject
(University of Madras)
Submitted By
SASIKALA A V-222211065
SHALINI R-222211067
VARSHA SRI H-222211071
Under the Supervision and Guidance of
Prof. E.S. VIJAYSHANKAR, M.Sc., M.Phil.,
Assistant professor
DEPARTMENT OF COMPUTER SCIENCE
ESSM COLLEGE OF ARTS AND SCIENCE
(University of Madras)
Submitted By
SASIKALA A V-222211065
SHALINI R-222211067
VARSHA SRI H-222211071
Under the Supervision and Guidance of
Prof. E.S. VIJAYSHANKAR, M.Sc., M.Phil.,
Assistant professor
DEPARTMENT OF COMPUTER SCIENCE
ESSM COLLEGE OF ARTS AND SCIENCE
CERTIFICATE
DECLARATION
DATE: Signature
ACKNOWLEDGEMENT
Finally, I bow my head before God almighty who blessed me with enough physical
and mental strength for the successful completion of the project.
SASIKALA A V
SHALINI R
VARSHA SRI H
TABLE OF CONTENT
1 Abstract
2 Introduction
5 Project Overview
11 Conclusion
12 Future Scope
13 Bibliography
GROCERY STORE MANAGEMENT SYSTEM
A.V.Sasikala, R.Shalini, H.Varsha sri
Abstract
The purpose of the Grocery Store Management System is to automate
the existing manual system with the help of computerized equipment and full-
fledged computer software, fulfilling their requirements, so that their valuable
data/information are often stored for an extended period with easy accessing
and manipulation of the same. The required software and hardware are easily
available and straightforward to figure with.
In computer system the process has to fill the various forms & number
of copies of the forms can be easily generated at a time.
➢ The system generates types of information that can be used for various
purposes.
➢ Be easy to operate.
➢ Be expandable.
This project creates a Grocery Management System using the Tkinter library
in Python. It features functionalities such as adding, updating, deleting, and
searching grocery items, with the data saved in and loaded from a JSON file.
1. Class: GroceryApp
The class GroceryApp is the heart of the system. It manages the GUI
components and interactions between the user and the grocery list.
• Initializes the GUI window, sets up the title, geometry, and background
color.
• Initializes the items dictionary to store grocery items and file_path for
storing the data.
• Entry Fields for adding new grocery items (item name, quantity, and
price).
• Adds the item to the items dictionary with the format items[name] =
(quantity, price).
• Deletes the item from the items dictionary and updates the tree view.
• Allows the user to select an item and update its quantity and price.
• Updates the selected item in the dictionary and refreshes the view.
• Loops through the items dictionary and inserts each item into the tree
view.
• Displays only the items whose name contains the search term (case-
insensitive).
4. Saving & Loading Data
• Attempts to load the items from a previously saved JSON file using
json.load().
5. Supporting Methods
a. clear_entries(self)
• Clears all entry fields for item name, quantity, price, and search term.
b. on_treeview_select(self, event)
• Automatically fills the entry fields with the data of the selected item in
the tree view. This allows users to easily update or delete an item after
selecting it.
6. UI Design
• Modern buttons with colors and flat relief for clear visual distinction.
• Treeview for organizing items into columns and rows for better
readability.
• Scrollbars for easy navigation when there are too many items to
display.
7. Main Execution
• The code initializes the root window and starts the Tkinter main loop.
8. Error Handling
• Handles file loading errors, displaying a warning if the saved JSON file
is not found.
Project Overview
Data Persistence: Save and load data using JSON for long-term storage.
Setting Up the Environment
Tkinter: The standard Python library for creating graphical user interfaces.
Installation Guide
Python: Download and install the latest version of Python from the official
website.
Tkinter: Typically included with Python, but can be installed via pip if
missing.
What is Tkinter?
Basics of Tkinter
Tkinter simplifies the process of creating windows, dialogs, buttons, and other
GUI elements. Its straightforward syntax makes it ideal for beginners and
experienced developers alike.
The user interface consists of entry fields for item details, buttons for CRUD
operations, and a tree view for displaying items.
Creating Widgets
Adding Items
Define the method to search for items based on the search term.
Data Persistence with JSON
Introduction to JSON
1. Start
2. Main Menu
• Display GUI with input fields for item name, quantity, and price.
• Display buttons for adding, deleting, updating, saving, loading, and
searching items.
• Display Tree view to show items.
3. Add Item
4. Delete Item
5. Update Item
• Display all items stored in the dictionary within the Tree view.
7. Search Item
8. Save Items
9. Load Items
• The app loads items from a JSON file into the app's dictionary and
updates the Tree view.
10.End
FLOW CHART DIAGRAM
Full Grocery Management System Project Source Code
Deploying the Application
• In the future, User can add feedback of the services available in online
grocery Store.
• This project does not give the information about the stock (quantity)
present within the shop.
Tkinter Documentation:
• Documentation:
https://docs.python.org/3/library/tkinter.html
• Website: https://www.python.org/
• Documentation:
https://docs.python.org/3/library/json.html
Tree view Widget - Tkinter:
• Documentation:
https://tkdocs.com/tutorial/widgets.html#treeview
• Documentation:
https://docs.python.org/3/library/tkinter.messagebox.html
Tkinter Tutorials:
• Tutorial: https://realpython.com/python-gui-tkinter/