0% found this document useful (0 votes)
14 views21 pages

Bakerymanagement FINAL Pro Cs

Uploaded by

snehasaran0707
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views21 pages

Bakerymanagement FINAL Pro Cs

Uploaded by

snehasaran0707
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

DELHI PUBLIC SCHOOL RANIPUR

HARIDWAR

BAKERY MANAGEMENT SYSTEM

PYTHON-MYSQL Connectivity
Project Report File
COMPUTER SCIENCE (083)

Submitted To: Submitted By:

Mr. Nadeem Sneha


Prisha mittal
Class XII-F
CERTIFICATE

This is to certify that “Sneha and Prisha mittal” student of class XII
– F Science (PCM) Delhi Public School Ranipur has successfully
completed their Computer Science project file on Topic Bakery
Management System under the guidance of “Mr. Nadeem”.

I certify that the practical is up to my expectation and as per the


guidance of CBSE.

___________________ ___________________
External Signature Internal Signature

1
ACKNOWLEDGEMENT

I take this opportunity to express my deep sense of gratitude to all


those who have been instrumental in preparation of this project and
the help of these individuals.

I feel related in manifesting our sense of gratitude to our internal


project guide Mr. Nadeem , Department of computer science. She
has been a constant source of inspiration for us and we are very
deeply thankful to him for his support and valuable advice.

I would finally like to express my heartfelt thanks to all of our


friends and family who helped us in successful completion of this
project within time.

2
INDEX

1. Introduction

2. Overview of Project

3. Overview of Python & MYSQL

4. Source Code

5. Output

6. Conclusion

7. Reference

3
INTRODUCTION

Bakery Management System is a totally computer based


software application to maintain day to day transactions in a
bakery. This software helps to store all bakery items with
category and sub-category. It also maintains record of
purchase and sales. It maintains details of the Supplier. This
application generates reports of purchase, sales and stock.
The system reflects standard structure so that any inventory
management system can implement this system easily in their
existing system. The system works to reduce human efforts.
Due to totally computerized occurrence of error is less &
works smoothly. It is a user-friendly system.

Advantages Of Proposed System -


• Easy to use and an efficient computerized system.
• To develop an accurate and flexible system, it will
eliminate data redundancy.
• Computerization can be helpful as a means of saving
time and money.
• To provide better Graphical User Interface (GUI).
• Less chances of information leakage.
• Provides Security to the data by using login and
password methods.

4
OVERVIEW OF PROJECT

The project will store the data (product names and their prices) of
our bakery in a database.

The data can be accessed as:

1. Admin Login:

The admin can access the data, view the items, add or delete an
item, and update the price of an item.

2. Customer login:

This will be the login for customer billing. Biller will note the
items and their quantities as per the customer’s input and generate
the bill for the same.

5
FUNCTIONS:

● display_items : - The function is used to display the all the


records in the table.
● admin_login: - Admin function is used to Add, Remove,
Delete, See and Exit option.
● customer_login: - Customer function displays two options.
Billing and
● Exit is used to calculate the amount and Exit option is used to
exit from the menu.

MODULES

● Time – It is used to display the time.


● Mysql - MySQL Connector/Python enables Python programs
to access
● MySQL databases, using an API that is compliant with the
Python Database API

6
OVERVIEW OF PYTHON AND SQL

PYTHON

Python has a large and active community of developers who


contribute to its growth. This results in a wealth of resources,

tutorials, libraries, and frameworks that can help with various


programming tasks.

Python is widely used in many domains, including web


development, scientific computing, data analysis, artificial
intelligence, machine learning, automation, and more. It has a
strong presence in frameworks such as Django and Flask for web
development, NumPy and pandas for data analysis, TensorFlow
and PyTorch for machine learning, and many others.

Overall, Python's simplicity, readability, and versatility make it an


excellent choice for a wide range of programming tasks. Whether
you're a beginner or an experienced developer, Python offers a
productive and enjoyable programming experience.

7
MYSQL

● MySQL is an open-source, relational database management


system(RDBMS) that is based on Structured Query
Language(SQL).

● One important thing to note here is that MySQL is used to


store data and it is not used to create programs; Thus it is not a
Programming Language.

● MySQL is used to store data and it is not used to create


programs; Thus,it is not a Programming Language.

● To store information in the MySQL database there is a need to


create the tables. It is also required to select our database first
and then create tables inside that database.

8
PROJECT CODE
'''
facilities: messages, view menu
1. admin login: add new item | delete item | change item price
2. customer : billing | customer name, phone number
3. exit
'''
import sqlite3
import time
connection = sqlite3.connect('menu.db')
cursor = connection.cursor()
cursor.execute('''CREATE TABLE IF NOT EXISTS
Menu([product_id] INTEGER PRIMARY KEY
AUTOINCREMENT,
[product_name] TEXT,
[product_price] INTEGER)''')
query = '''SELECT * FROM Menu'''
cursor.execute(query)
results = cursor.fetchall()
if results==[]:
cursor.execute('''
INSERT INTO Menu (product_name, product_price)
VALUES
('Cake',400),
('Bread',50),

9
('Cookies',100),
('Doughnuts',80),
('Pie',120)
''')
connection()
def display_items(cursor):
query='''SELECT * FROM Menu'''
cursor(query)
results=cursor()
print("List of items: ")
print("ID","Name","Price",sep=" ")
for each in results:
print(each[0],each[1],each[2],sep=" ")
def admin_login(connection,cursor):
print()
print("---------Welcome! You are logged in as Admin!----------")
print()
print("Here are the list of choices:")
print("Choice 1: Add an item",
"Choice 2: Remove an item",
"Choice 3: Update item price",
"Choice 4: See all the items",
"Choice 5:Exit",

10
sep="\n")
choice = int(input("Enter your choice: "))
print()
time(0)
if choice==1:
print("What you like to add?")
product_name = input("Enter product name: ")
product_price = input("Enter product price: ")
try:
query=f'''INSERT INTO Menu(product_name, product_price)
VALUES
('{product_name}','{product_price}')'''
cursor(query)
connection()
print("The item has been added to the list!")
except Exception as e:
print("Error occured!")
time(1)
admin_login(connection,cursor)
elif choice==2:
display_items(cursor)
print("Which item you would like to remove?")
id = int(input("Enter product id:"))

11
try:
query=f'''DELETE FROM Menu WHERE product_id={id}'''
cursor(query)
connection()
print("The item has been removed from the shop!")
except Exception as e:
print("Invalid item!")
time(1)
admin_login(connection,cursor)
print("-----------Welcome,You are logged in as a
biller!-------------")
print("Here is the list of choices:")
print("Choice 1: Billing", "Choice 2: Exit",sep="\n")
choice = int(input("Enter your choice:"))
if(choice==1):
name = input("Enter the customer name:")
print(f"What do you wanna buy {name}?")
time(0)
display_items(cursor)
print()
total = 0
items=[]
while 1:

12
id=int(input("Enter the product ID:"))
quantity =int(input("Enter the quantity:"))
try:
query=f'''SELECT * FROM Menu WHERE product_id={id}'''
cursor(query)
result=cursor()
total += result[2]*quantity
items([result[1],quantity])
i=input("Anything else?Answer Y for Yes and N for No! ")
if(i=='N'):
break
except Exception as e:
print("Invalid Entry!")
print(e)
break
if(total!=0):
print()
print("---------Moon Pie Bakery--------")
print("-------Billing Details-------")
print(f"Name:{name}")
print(f"Items:")
for each in items:
print(each[0],each[1],sep=":")

13
print(f"Total: {total}")
print("Thank you! Have a sweet day!")
print()
time(1)
customer_login(connection,cursor)
elif choice==2:
main()
else:
print("Invalid Choice!")
time(1)
customer_login(connection,cursor)
def main():
inloop = 1
while inloop:
print()

14
OUTPUT

15
16
17
18
CONCLUSION

● The present is manual processes are time consuming and prone to


error.

● Manual entries cause errors while registering the data.

● The computerized system arranges all sequentially which


ensures quick retrieval of required entries whenever
necessary.

● It is less time consuming and more accurate.

● This is our sincere efforts to make this software standup to both


customers as well as the owner.

19
REFERENCE

1) http://www.google.com

2) https://www.w3schools.com

3) https://www.tutorialspoint.com/

4) http://www.wikepedia.com

5) http://www.youtube.com

20

You might also like