0% found this document useful (0 votes)
27 views

Shop Management System in python

The Shop Management System is a Python project aimed at enhancing shop operations through a GUI, utilizing Tkinter and MySQL for product management and billing. Key features include adding, deleting, and viewing products, as well as generating bills for customers. The project is designed for small businesses to streamline daily operations and offers potential enhancements like search functionality and sales analytics.

Uploaded by

Gaurav Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Shop Management System in python

The Shop Management System is a Python project aimed at enhancing shop operations through a GUI, utilizing Tkinter and MySQL for product management and billing. Key features include adding, deleting, and viewing products, as well as generating bills for customers. The project is designed for small businesses to streamline daily operations and offers potential enhancements like search functionality and sales analytics.

Uploaded by

Gaurav Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

SHOP MANAGEMENT

SYSTEM IN
PYTHON
submitted to
Amity Online University

submitted by
Aayushi Kumar, Semester - III, 2023 - 2025,
Masters of Computer Application,
A9929723002127(el)
INDEX

INTRODUCTION
PREREQUISITES
WORKING EXPLANATION
OUTPUT
SUMMARY
BIBLIOGRAPHY
INTRODUCTION

We all go shopping to buy products of our requirement. We all


would have observed that the shops are moving towards digital
systems for bill computation. In this Python project, we will be
building such a shop management system to manage the shop
products and bills.

About Shop Management System:


Shop management is an application that helps in
managing the products and tracking the sales in the
shop. This is a project that not only reduces labor and
time but also helps the user have a record of the sales in
a database.

Shop Management System using Python:


We will build this project using the Tkinter and MySQL
Connector modules in Python. We use the MySQL
Connector to store the details in a table and access
them. Using this we will build GUI where the user gets to
do the following:

1. Add a product
2. Delete a product
3. View all products
4. Generate a bill and store it in a database
PREREQUISITES

Prior knowledge on Python, the Tkinter module, and MySQL


queries would help the developer while building this project. You
can install the above modules using the following commands.

1. PIP INSTALL MYSQL-CONNECTOR


2. PIP INSTALL TKINTER

PROJECT FILE STRUCTURE


The following steps are to be followed to build Python shop
management system project:

1. IMPORTING THE MODULES


2. CONNECTING TO DATABASE AND CREATING TABLES
3. CREATING THE MAIN WINDOW
4. FUNCTION TO ADD PRODUCT
5. FUNCTION TO DELETE PRODUCT
6. FUNCTION TO VIEW ALL PRODUCTS
7. FUNCTION TO CREATE A NEW BILL
WORKING EXPLANATION

1. IMPORTING THE MODULES:

THE FIRST STEP IS TO IMPORT THE TKINTER AND MYSQL


CONNECTOR MODULES.

CODE EXPLANATION:

Font in tkinter is used to set the font of the text.


messagebox helps in showing the pop up messages.
2. CONNECTING TO DATABASE AND CREATING TABLES:

CODE EXPLANATION:

connect(): It is used to connect to the database server on your


device using the username and password.
cursor(): The cursor object helps in executing the SQL queries.
execute(): This executes the command given as input.
3. CREATING THE MAIN WINDOW:

Now, we create the main window with buttons to do the following


operations:
a. Add a product
b. Delete a product
c. View all products
d. Generate a bill and store it in a database
CODE EXPLANATION:

title(): It displays the title on the top of the window.


config(): It sets the background color of the window.
geometry(): It sets the length and width of the window.
Frame(): It creates a Frame, a rectangular object that holds
various widgets, on the screen.
place(): This is used to locate the widgets in a particular position
based on coordinates or relative to the parent component.
Label(): This creates a label to show text.
Button(): This creates a button with mentioned properties and
the command parameter represents the function that executed
on pressing the button.
mainloop(): This makes sure the screen runs till manually closed
by the user.
4. FUNCTION TO ADD PRODUCT:

In this step, we create a window to take input of product details


from the user and then add it to the database.
CODE EXPLANATION:

title(): It displays the title on the top of the window.


config(): It sets the background color of the window.
geometry(): It sets the length and width of the window.
Frame(): It creates a Frame, a rectangular object that holds
various widgets, on the screen.
place(): This is used to locate the widgets in a particular position
based on coordinates or relative to the parent component.
Label(): This creates a label to show text.
Entry(): This widget takes the input from the user.
Button(): This creates a button with mentioned properties and
the command parameter represents the function executed on
pressing the button.
mainloop(): This makes sure the screen runs till manually closed
by the user.
connect(): It is used to connect to the database server on your
device using the username and password.
cursor(): The cursor object helps in executing the SQL queries.
execute(): This executes the command given as input.
5. FUNCTION TO DELETE PRODUCT:

In this step, we create a window to take input of product name


from the user. And then delete the details of that product from
the database.
CODE EXPLANATION:

title(): It displays the title on the top of the window.


config(): It sets the background color of the window.
geometry(): It sets the length and width of the window.
Frame(): It creates a Frame, a rectangular object that holds
various widgets, on the screen.
place(): This is used to locate the widgets in a particular position
based on coordinates or relative to the parent component.
Label(): This creates a label to show text.
Entry(): This widget takes the input from the user.
Button(): This creates a button with mentioned properties and
the command parameter represents the function executed on
pressing the button.
mainloop(): This makes sure the screen runs till manually closed
by the user.
connect(): It is used to connect to the database server on your
device using the username and password.
cursor(): The cursor object helps in executing the SQL queries.
execute(): This executes the command given as input.

6. FUNCTION TO VIEW ALL PRODUCTS:

In this step we connect to the database, get the details of all the
products and show them on the screen.
CODE EXPLANATION:

title(): It displays the title on the top of the window.


config(): It sets the background color of the window.
geometry(): It sets the length and width of the window.
Frame(): It creates a Frame, a rectangular object that holds
various widgets, on the screen.
place(): This is used to locate the widgets in a particular position
based on coordinates or relative to the parent component.
Label(): This creates a label to show text.
Entry(): This widget takes the input from the user.
Button(): This creates a button with mentioned properties and
the command parameter represents the function that executed
on pressing the button.
mainloop(): This makes sure the screen runs till manually closed
by the user.
connect(): It is used to connect to the database server on your
device using the username and password.
cursor(): The cursor object helps in executing the SQL queries.
execute(): This executes the command given as input.
7. FUNCTION TO CREATE A NEW BILL:

In this step we create a window to take input of quantities for


each product to be brought. If not required to buy, that entry is
left empty. Then on clicking the button to generate a bill, we
calculate the price and show the final bill details from the user.
CODE EXPLANATION:

title(): It displays the title on the top of the window.


config(): It sets the background color of the window.
geometry(): It sets the length and width of the window.
Frame(): It creates a Frame, a rectangular object that holds
various widgets, on the screen.
place(): This is used to locate the widgets in a particular position
based on coordinates or relative to the parent component.
Label(): This creates a label to show text.
Entry(): This widget takes the input from the user.
Button(): This creates a button with mentioned properties and
the command parameter represents the function executed on
pressing the button.
mainloop(): This makes sure the screen runs till manually closed
by the user.
connect(): It is used to connect to the database server on your
device using the username and password.
cursor(): The cursor object helps in executing the SQL queries.
execute(): This executes the command given as input.
OUTPUT
SUMMARY
The Shop Management System is a Python-based project
designed to streamline shop operations through a user-
friendly graphical user interface (GUI). The project utilizes
libraries like Tkinter for the GUI and supports functionalities
to manage products and generate bills for customers. Below
are the key components of the project:

Features:
1. Add Products:
Allows the shop owner to add new products to the inventory.
Inputs include product name, price, and quantity.
Data is stored in an organized structure (e.g., lists, dictionaries, or a database).
2. Delete Products:
Provides an option to remove products from the inventory.
Products can be selected from a list and deleted based on their unique identifier or
name.
3. View Products:
Displays the current list of products in inventory along with their details (e.g., name,
price, quantity).
Can use a table view or a simple list for display.
4. New Customer:
Opens a billing interface for a new customer.
The user can select products from the inventory, specify quantities, and generate a bill.
The bill includes itemized details (product names, prices, quantities, and totals).
5. Generate Bill:
Calculates the total amount for the selected products.
Displays the bill in a formatted style.

Technologies and Libraries Used:


Python: Core programming language.
Tkinter: For building the GUI components.

Potential Enhancements:
Add a search bar to filter products.
Include a login system for shop administrators.
Provide sales analytics (e.g., daily revenue, best-selling products).
Integrate barcode scanning for product entry.
Include GST/tax calculation in the billing process.

This project is suitable for small-scale businesses to manage daily operations


effectively while providing a practical application of Python programming.
BIBLIOGRAPHY

1. BOOKS:

Lutz, M. (2013). Learning Python (5th ed.). O’Reilly Media.


For understanding Python programming fundamentals and advanced techniques.
Grayson, J. (2000). Python and Tkinter Programming. Manning Publications.
A comprehensive guide to building GUI applications using Tkinter.

2. ONLINE DOCUMENTATION:

Python Software Foundation. Python 3 Documentation. Retrieved from


https://docs.python.org/3/
Official documentation for Python, covering libraries and modules.
Tkinter Documentation. Tkinter Reference Guide. Retrieved from
https://docs.python.org/3/library/tkinter.html
Official guide for Tkinter components and usage.

3. TUTORIALS AND GUIDES:

GeeksforGeeks. Python GUI – Tkinter. Retrieved from


https://www.geeksforgeeks.org/python-gui-tkinter/
Step-by-step tutorials for creating GUI applications in Python.
Real Python. Python GUI Programming With Tkinter. Retrieved from
https://realpython.com/python-gui-tkinter/
Detailed examples for GUI development using Tkinter.

You might also like