Library Management System Project
Library Management System Project
PROJECT FILE
BY Aksh JAISWAL
Signature of signature of
Internal examiner external examiner
__________ __________
ACKNOWLEDGMENT
Database: aksh_library_management
TABLE: AVAILABLE_BOOKS
Table: Issued
Table: Login
Table: Members
Python Source code:
import mysql.connector
# Connect to MySQL
mycursor = mydb.cursor()
print("""
========================================================
========================================================
""")
mycursor.execute("USE aksh_library_management")
name VARCHAR(50),
subject VARCHAR(50),
quantity INT)""")
subject VARCHAR(50),
s_name VARCHAR(50),
s_class VARCHAR(25),
issue_date DATE,
due_date DATE)""")
user VARCHAR(25),
password VARCHAR(25))""")
name VARCHAR(50))""")
mydb.commit()
if mycursor.fetchone() is None:
mydb.commit()
members = [
'Aditya Choudhary',
'Akshay Sengar',
'Vikrant Tyagi',
'Chirag Goyal',
'Harshit Bhardwaj',
'Amandeep Singh',
'Divyansh Gupta',
'Devanshu Panchal',
'Kartikay Vashist',
'Kairav Choudhary',
'Ridhem Sehgal',
'Kartik',
'Dask Saini',
'Krish Burman'
if mycursor.fetchone() is None:
mydb.commit()
while True:
print("""
1.) Login
2.) Exit
""")
if ch == 1:
pas = input("Enter password: ")
if pas == t_pas:
print("Login Successfully...")
loop1 = 'n'
print("""
____________________________________________
5. Return book
8. View members
9. Remove member
11. Logout
_____________________________________________
""")
if ch == 1:
loop2 = 'y'
mydb.commit()
# Remove Book
elif ch == 2:
if mycursor.fetchone():
mydb.commit()
else:
if mycursor.fetchone():
new_name = input("Enter new book name (or press enter to skip): ")
if new_name:
if new_subject:
if new_quan:
mydb.commit()
else:
# Issue Book
elif ch == 4:
loop2 = 'y'
while loop2 == 'y':
issue_date = datetime.now().date()
book = mycursor.fetchone()
if book:
if t_quan > 0:
new_quan = t_quan - 1
VALUES
mydb.commit()
else:
else:
print("Invalid input...")
elif ch == 5:
loop2 = 'y'
issued_book = mycursor.fetchone()
if issued_book:
current_date = datetime.now().date()
if fine > 0:
book = mycursor.fetchone()
new_quan = t_quan + 1
mydb.commit()
print("Book successfully returned...")
else:
elif ch == 6:
for i in mycursor:
elif ch == 7:
print("ID | Name | Subject | Student Name | Student Class | Issue Date |Due Date")
for i in mycursor:
# View Members
elif ch == 8:
print("ID | Name")
for i in mycursor:
print(f"{i[0]} | {i[1]}")
# Remove Member
elif ch == 9:
if mycursor.fetchone():
mydb.commit()
else:
elif ch == 10:
if mycursor.fetchone():
mydb.commit()
else:
# Logout
elif ch == 11:
break
else:
print("Incorrect Password!")
elif ch == 2:
print("Exiting...")
break
else:
print("Invalid choice!")
Outputs
Login:
Adding new books:
Issuing Books:
Result:-
Exiting the program:
Bibliography
Source:
tutorialsPoint.com
LearnPython.org
www.python.org
Software:
MySQL
Python idle
Books:
Class 12 computer science by Preeti Arora book