Wa0008.
Wa0008.
1 INTRODUCTION
4 SYSTEM REQUIREMENTS
5 SOURCE CODE
6 SAMPLE INPUT/OUTPUT
7 CONCLUSION
8 BIBLIOGRAPHY
INTRODUCTION
and Modula-3. It has efficient high-level data structures and a simple but effective
typing, together with its interpreted nature, make it an ideal language for scripting
and rapid application development in many areas on most platforms. The Python
interpreter is easily extended with new functions and data types implemented in C or
C++ (or other languages callable from C). Python is also suitable as an extension
and is backed by Oracle. SQL is the core of a relational database which is used for
accessing and managing the database. By using SQL, you can add, update or delete
rows of data, retrieve subsets of information, modify databases and perform many
actions.
association with MySQL i.e. available in the syllabus of CBSE Class XII for the
part of library staff. The use of library management system helps the librarian and
other staff members to manage library easily along with saving time. This allows the
librarian to catalogue books and to maintain records of issued and overdue books
easily. It consists of the comprehensive options for entering the information related
to books thus helping to maintain the complete library right from the transactions
between student, staff and institute to issuing, returning and reissuing of books to
maintaining membership information on one centralized server. This has eased and
made the process of borrowing books error free for everyone. In fact every little task
which was done manually by library staff has been fully automated so as to
smoothen the working of library along with bringing transparency in its functioning
easily. Management using pen and paper is absurd in the modern era. These days
most of the schools and institutions have large libraries and students frequently issue
books, so librarians often find it difficult to manage the process manually. On the
other hand, a virtual library management system eliminates all these burdens. By
using this system, all records can be generated quickly. This is a very versatile
project that allows the user (the librarian) to enter the name, number, and other
details of books that are issued by a student. Thus the project aims in creating a good
File lost
human environment. Sometimes due to some human error there may be a loss of
records.
File damaged
When a computerized system is not there file is always lost due to some
accident like spilling of water by some member on file accidentally, besides some
natural disaster like floods or fires may also damage the files.
Space consuming
After the number of records becomes large the space for physical storage of
Cost consuming
HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS
Operating System: Windows 98, 2000, XP, 7, 8, 8.1, 10 Tools: Python 3.5, Mysql
SOURCE CODE
import Book
import issue
while True:
Book.clrscreen()
print("==============================================================")
print("==============================================================")
if choice==1:
menulib.MenuBook()
elif choice==2:
menulib.MenuMember()
elif choice==3:
menulib.MenuIssueReturn()
elif choice==4:
break
else:
import Book
import member
import issue
def MenuBook():
while True:
Book.clrscreen()
print("============================================================")
print("============================================================")
if choice==1:
Book.insertData()
elif choice==2:
Book.display()
elif choice==3:
Book.SearchBookRec()
elif choice==4:
Book.deleteBook()
elif choice==5:
Book.UpdateBook()
elif choice==6:
return
else:
#----------------------------------------------------------------------------------------
def MenuMember():
while True:
Book.clrscreen()
print("============================================================")
print("============================================================")
if choice==1:
member.insertMember()
elif choice==2:
member.display()
elif choice==3:
member.SearchMember()
elif choice==4:
member.deleteMember()
elif choice==5:
member.UpdateMember()
elif choice==6:
return
else:
#----------------------------------------------------------------------------------------
def MenuIssueReturn():
while True:
Book.clrscreen()
print("============================================================")
print("============================================================")
if choice==1:
issue.issueBook()
elif choice==2:
issue.ShowIssuedBooks()
elif choice==3:
issue.returnBook()
elif choice==4:
return
else:
import mysql.connector
import os
import platform
def clrscreen():
if platform.system()=="Windows":
print(os.system("cls"))
def display():
try:
os.system('cls')
cnx = connection.MySQLConnection(user='root',
passwd='Smic123\"',host='localhost',database='LIbrary')
Cursor = cnx.cursor()
Cursor.execute(query)
print("===========================================================")
print("Purchased On : ",d_o_purchase)
print("===========================================================")
Cursor.close()
cnx.close()
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
#else:
#cnx.close()
def insertData():
try:
cnx = connection.MySQLConnection(user='root',passwd='Smic123\"',host='localhost',
database='Library')
Cursor = cnx.cursor()
Qry = ("INSERT INTO BookRecord VALUES (%s, %s, %s, %s, %s, %s, %s)")
data = (bno,bname,Auth,price,publ,qty,date(YY,MM,DD))
Cursor.execute(Qry,data)
cnx.commit()
Cursor.close()
cnx.close()
print("Record Inserted..............")
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
#cnx.close()
def deleteBook():
try:
cnx = connection.MySQLConnection(user='root',passwd='Smic123\"',host='localhost',
database='Library')
Cursor = cnx.cursor()
Cursor.execute(Qry,del_rec)
cnx.commit()
Cursor.close()
cnx.close()
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
#cnx.close()
def SearchBookRec():
try:
cnx = connection.MySQLConnection(user='root',passwd='Smic123\"',host='localhost',
database='Library')
Cursor = cnx.cursor()
rec_srch=(bno,)
Cursor.execute(query,rec_srch)
Rec_count=0
Rec_count+=1
print("===========================================================")
print("Publisher : ",publ)
print("Purchased On : ",d_o_purchase)
print("===========================================================")
if Rec_count%2==0:
clrscreen()
cnx.commit()
Cursor.close()
cnx.close()
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
#cnx.close()
def UpdateBook():
try:
cnx = mysql.connector.connect(host="localhost", user="root", passwd="Smic123\"",
database="library")
Cursor = cnx.cursor()
#rec_srch=(bno,)
bname=%s,Author=%s,price=%s,publisher=%s,qty=%s,d_o_purchase=%s
WHERE BNO=%s")
data = (bname,Auth,price,publ,qty,date(YY,MM,DD),bno)
Cursor.execute(Qry,data)
cnx.commit()
Cursor.close()
cnx.close()
else:
print(err)
#cnx.close()
import os
def clrscreen():
print('\n' *5)
def ShowIssuedBooks():
try:
os.system('cls')
database='Library')
Cursor = cnx.cursor()
Cursor.execute(query)
print("===========================================================")
print("===========================================================")
Cursor.close()
cnx.close()
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
else:
cnx.close()
def issueBook():
try:
cnx = connection.MySQLConnection(user='root',password='Smic123\"',host='localhost',
database='Library')
Cursor = cnx.cursor()
issueDate=date.today()
Cursor.execute(Qry,data)
cnx.commit()
Cursor.close()
cnx.close()
print("Record Inserted..............")
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
#cnx.close()
def returnBook():
try:
cnx = connection.MySQLConnection(user='root',password='Smic123\"',host='localhost',
database='Library')
Cursor = cnx.cursor()
retDate=date.today()
Qry =("""Update Issue set d_o_ret= %s WHERE BNO = %s and Mno= %s """)
rec=(retDate,bno,Mno)
Cursor.execute(Qry,rec)
cnx.commit()
Cursor.close()
cnx.close()
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
#cnx.close()
import os
def clrscreen():
print('\n' *5)
def display():
try:
os.system('cls')
database='LIbrary')
Cursor = cnx.cursor()
Cursor.execute(query)
for (Mno,Mname,MOB,DOP,ADR) in Cursor:
print("===========================================================")
print("Address : ",ADR)
print("===========================================================")
Cursor.close()
cnx.close()
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
#else:
# cnx.close()
def insertMember():
try:
cnx = connection.MySQLConnection(user='root',password='Smic123\"',host='localhost',
database='Library')
Cursor = cnx.cursor()
Qry = ("INSERT INTO Member VALUES (%s, %s, %s, %s, %s)")
data = (mno,mname,mob,date(YY,MM,DD),addr)
Cursor.execute(Qry,data)
cnx.commit()
Cursor.close()
cnx.close()
print("Record Inserted..............")
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
#cnx.close()
def deleteMember():
try:
cnx = connection.MySQLConnection(user='root',passwd='Smic123\"',host='localhost',
database='Library')
Cursor = cnx.cursor()
del_rec=(mno,)
Cursor.execute(Qry,del_rec)
cnx.commit()
Cursor.close()
cnx.close()
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
#cnx.close()
def SearchMember():
try:
cnx = connection.MySQLConnection(user='root',password='Smic123\"',host='localhost',
database='Library')
Cursor = cnx.cursor()
Cursor.execute(query,rec_srch)
Rec_count=0
print("===========================================================")
print("Address : ",ADR)
print("===========================================================")
if Rec_count%2==0:
clrscreen()
cnx.commit()
Cursor.close()
cnx.close()
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
def UpdateMember():
try:
database="library")
Cursor = cnx.cursor()
data = (mname,mob,date(YY,MM,DD),addr,mno)
Cursor.execute(Qry,data)
cnx.commit()
Cursor.close()
cnx.close()
if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
else:
print(err)
DATABASE & TABLE DETAILS
SAMPLE INPUT/OUTPT
Library Management
==============================================================
1. Book Management
2. Members Management
3. Issue/Return Book
4. Exit
==============================================================
Enter Choice between 1 to 4-------> : 1
Book Record Management
==============================================================
1. Add Book Record
2. Display Book Records
3. Search Book Record
4. Delete Book Record
5. Update Book Record
6. Return to Main Menu
==============================================================
Enter Choice between 1 to 5-------> : 1
Enter Book Code : 201
Enter Book Name : Computer Science with Python
Enter Book Author's Name : SUMITA ARORA
Enter Book Price : 550
Enter Publisher of Book : DHANPAT RAI
Enter Quantity purchased : 50
Enter Date of Purchase (Date/MOnth and Year seperately:
Enter Date : 14
Enter Month : 1
Enter Year : 2020
Record Inserted..............
Enter Month : 1
Enter Year : 2020
-1 Record(s) Updated Successfully.............
Enter any key to continue
Book Record Management
==============================================================
1. Add Book Record
2. Display Book Records
3. Search Book Record
4. Delete Book Record
5. Update Book Record
6. Return to Main Menu
==============================================================
Enter Choice between 1 to 5-------> : 6
Enter any key to continue
Library Management
==============================================================
1. Book Management
2. Members Management s
3. Issue/Return Book
4. Exit
==============================================================
Enter Choice between 1 to 4-------> : 2
Member Record Management
==============================================================
1. Add Member Record
2. Display Member Records
3. Search Member Record
4. Delete Member Record
5. Update Member Record
6. Return to Main Menu
==============================================================
Enter Choice between 1 to 5-------> : 1
Enter Member Code : 101
Enter Member Name : ANIL KUMAR
Enter Member Mobile No. : 9410268234
Enter Date of Membership (Date/MOnth and Year seperately:
Enter Date : 14
Enter Month : 1
Enter Year : 2021
Enter Member Adress : ETAWAH
Record Inserted..............
Enter any key to continue
Member Record Management
==============================================================
1. Add Member Record
2. Display Member Records
3. Search Member Record
4. Delete Member Record
5. Update Member Record
6. Return to Main Menu
==============================================================
Enter Choice between 1 to 5-------> : 3
Enter the Member Code to be Searched : 100
==============================================================
Member Code : 100
Member Name : ARJUN A NAIR
Mobile No.of Member : 9410268234
Date of Membership : 2021-01-14
Address : KOTTAYAM
==============================================================
Press any key to continue
Enter any key to continue
Member Record Management
==============================================================
1. Add Member Record
2. Display Member Records
3. Search Member Record
4. Delete Member Record
5. Update Member Record
6. Return to Main Menu
==============================================================
Enter Choice between 1 to 5-------> : 5
Enter the Member Code to be Updated : 100
Enter new data
Enter Member Name : ARJUN NAIR
Enter Member Mobile No. : 9458776516
Enter Date of Membership (Date/MOnth and Year seperately:
Enter Date : 11
Enter Month : 1
Enter Year : 2000
Enter Member Adress : AGRA
-1 Record(s) Updated Successfully.............
Enter any key to continue
Member Record Management
==============================================================
1. Add Member Record
2. Display Member Records
3. Search Member Record
4. Delete Member Record
5. Update Member Record
6. Return to Main Menu
==============================================================
Enter Choice between 1 to 5-------> : 4
Enter Member Code to be deleted from the Library : 100
-1 Record(s) Deleted Successfully.............
Enter any key to continue
Member Record Management
==============================================================
1. Add Member Record
2. Display Member Records
3. Search Member Record
4. Delete Member Record
5. Update Member Record
6. Return to Main Menu
==============================================================
After we have completed the project we are sure the problems in the existing system
computerized to reduce human errors and to increase the efficiency. The main focus
of this project is to lessen Human efforts. The maintenance of the records is made
efficient, as all the records are stored in the data file, through which data can be
retrieved easily. The navigation control is provided in all the forms to navigate
through the large amount of records. If the numbers of records are very large then
user has to just type in the search string and user gets the results immediately. The
Books and Students are given a particular unique id no, so that they can be accessed
correctly and without errors. Our main aim of the project is to get the correct
information about a particular student and books available in the library. The
problems, which existed in the earlier system, have been removed to a large extent.
And it is expected that this project will go a long way in satisfying users
improves the efficiency but will also reduce human stress thereby indirectly
Websites:
https://en.wikipedia.org/wiki/C%2B%2B
http://www.icbse.com/
Books: