SCHOOL NAME *ADDRESS*
*SCHOOL LOGO HERE*
LIBRARY MANAGEMENT
SYSTEM
SESSION : 20xx-20xx
CLASS-12
Submitted to: Submitted by:
TEACHER NAME YOUR NAME
Index
1. CERTIFICATE…………………………………………………………...3
2. ACKNOWLEDGEMENT………………………………………………...4
3. INTRODUCTION………………………………………………………...5
4. FEATURES……………………………………………………………….6
5. VALIDATION AND CHECKS…………………………………………..7
6. HARDWARE AND SOFTWARE REQUIREMENTS…………………..8
7. PROJECT FLOW DIAGRAM……………………………………………9
8. PROJECT FLOW DETAIL……………………………………………….10
9. PROGRAM CODING…………………………………………………….11-20
10. INPUT AND OUTPUT DESIGNS.………………………………………..21-29
[Link]…………………………………………………………30
Certificate
This is to certify that this is a bonafide record of the
project work done satisfactorily at
_________________________________________
______ by_______________ of class XII, on the
topic Library Management System in Python.
All the modules have been successfully completed
by him. The project has been submitted in hard and
soft copy in working condition with all the required
documents.
Project guide
(____________________)
Signature:
Acknowledement
In the accomplishment of this project successfully, many
people have best owned upon me their blessings and the
heart pledge support, this time I am utilizing to thank all
the people who have been concerned with this project.
Primarily I would like thank god for being able to
complete this project with success. Then I would like to
thank my principal *NAME HERE*and my computer
science teacher MRS. *NAME HERE* whose valuable
guidance has been the ones that helped me patch this
project and make it full proof success, his suggestions
and instruction has served as the major contribution
towards the completion of this project. Then I would like
to thank my parents who have helped me with their
valuable suggestions and guidance has been very helpful
in various phases of the completion of the project.
Student Name:
Board Roll No:
Class & Sec:
Student Signature:
Dated:
Introduction
This software project is a library management software
system with all the basic as well as some innovative
features for managing a library.
It consists of a large database of various books
available in the library. It also lists various books issued
to respective readers.
The system keeps track of all the books readily
available and the books that have been issued to various
readers for the time period for which the books have
been issued.
The system also handles books database.
Readers usually tend to forget the date to return their
library books, so this system even calculates fine
depending on the expiry date.
Thus, this library management system provides
enhanced library functionality for this modern world.
Features
It is a menu driven programme.
A lot of time, paper and human efforts are saved
as the data is managed electronically.
There is no need for the manual records to be
kept.
It also calculates the fine charged to the user due
to late return of a book.
The information of new arrival of books in library
and their availability can be updated in the system
by the admin.
Validation and
Checks
Whenever an issue is made, the name of the book issued and
the date of issue is saved on the system under the user
name/ID.
Readers usually tend to forget the date to return their library
books.
After entering name/ID of the user, the system first checks if an
issue has been made and the date of issue.
Then it checks the date expiry date.
It calculates fine depending on the expiry date.
Once the fine has been paid and the book has been turned the
due amount returns to zero.
Hardware And
Software
Requirements
Software Links:
Download Link Python: [Link]
Download Link for MySQL Server:
[Link]
Download Link for SQLite:
[Link]
Minimum System Requirements:
Processors: Intel® Core™ i3 processor or above
Disk space: 1 GB or above
Operating systems: Windows 8 or above
Python: Version 3.7.4 or above
MySQL Server: Version 5.1 or above
OR
SQLite version 3.36.0 or above
Project Flow
Diagram
Project Flow
Detail
First the used Id is entered into the database.
Program Coding
import [Link]
from datetime import date
mydb = [Link](host='localhost', database='library1',
user='root', password='0604')
def add_book():
.
sql = 'insert into member values(%s,%s,%s)'
cursor = [Link]()
[Link](sql,data)
[Link]()
print('\n\nNew Member added successfully')
main_menu()
def issue_book():
if choice == 4:
field = 'price'
book_id = input('Enter Book ID :')
value = input('Enter new value :')
if field =='pages' or field == 'price':
sql = 'update book set ' + field + ' = '+value+' where book_id =
'+book_id+';'
else:
if choice == 2:
field = 'phone'
mem_id =input('Enter member ID :')
value = input('Enter new value :')
sql = 'update member set '+ field +' = "'+value+'" where mem_id =
'+mem_id+';'
cursor = [Link]()
[Link](sql)
[Link]()
print('Member details Updated.....')
main_menu()
def mem_issue_status(mem_id):
sql ='select * from transaction where mem_id ='+mem_id +' and
date_return is NULL;'
cursor = [Link]()
[Link](sql)
results = [Link]()
return results
def book_status(book_id):
sql = 'select * from book where book_id ='+book_id + ';'
cursor = [Link]()
[Link](sql)
result = [Link]()
return result[4]
def book_issue_status(book_id,mem_id):
sql = 'select * from transaction where book_id ='+book_id + ' and
mem_id ='+ mem_id +' and date_return is NULL;'
cursor = [Link]()
[Link](sql)
result = [Link]()
return result
def issue_book():
print('\n BOOK ISSUE SCREEN ')
print('-'*120)
book_id = input('Enter Book ID : ')
mem_id = input('Enter Member ID :')
result = book_status(book_id)
result1 = mem_issue_status(mem_id)
today = [Link]()
if len(result1) == 0:
if result == 'available':
data=(book_id, mem_id, date_issue)
sql = 'insert into transaction values(s%,s%,s%);'
sql_book = 'update book set status="issue" where book_id
='+book_id + ';'
cursor = [Link]()
[Link](sql,data)
[Link](sql_book)
print('\n\n\n Book issued successfully')
else:
print('\n\nBook is not available for ISSUE... Current status :',result1)
else:
if len(result1)<1:
data= (book_id, mem_id, date_issue)
sql = 'insert into transaction) values(s%,s%,s%);'
sql_book = 'update book set status="issue" where book_id ='+book_id
+ ';'
cursor = [Link]()
[Link](sql,data)
[Link](sql_book)
[Link]()
print('\n\n\n Book issued successfully')
else:
print('\n\nMember already have book from the Library')
main_menu()
def return_book():
……………….
global fine_per_day
print('\n BOOK RETURN SCREEN ')
print('-'*120)
book_id = input('Enter Book ID : ')
mem_id = input('Enter Member ID :')
today =[Link]()
result = book_issue_status(book_id,mem_id)
if result==None:
print('Book was not issued...Check Book Id and Member ID again..')
else:
sql='update book set status ="available" where book_id ='+book_id
+';'
din = (today - result[3]).days
fine = din * fine_per_day
sql1 = 'update transaction set date_return ="'+str(today)+'" ,
fine='+str(fine)+' where book_id='+book_id +' and
mem_id='+mem_id+' and date_return is NULL;'
cursor = [Link]()
[Link](sql)
[Link](sql1)
[Link]()
print('\n\nBook returned successfully')
main_menu()
def search_book(field):
print('\n BOOK SEARCH SCREEN ')
print('-'*120)
. msg ='Enter '+ field +' Value :'
title = input(msg)
sql ='select * from book where '+ field + ' like "%'+ title+'%"'
cursor = [Link]()
[Link](sql)
records = [Link]()
print('Search Result for :',field,' :' ,title)
print('-'*120)
for record in records:
print(record)
[Link]()
main_menu()
def search_menu():
while True:
print(' S E A R C H M E N U ')
print("\n1. Book Title")
print('\n2. Book Author')
print('\n3. Exit to main Menu')
print('\n\n')
choice = int(input('Enter your choice ...: '))
field =''
if choice == 1:
field='title'
if choice == 2:
field = 'author'
if choice == 3:
break
search_book(field)
def change_book_status(status,book_id):
mydb = [Link](host='localhost', database='library',
user='root', password='')
cursor = [Link]()
sql = 'update book set status = "'+status +'" where id ='+book_id + '
and status ="available"'
[Link](sql)
print('Book status changed to ',status)
print('\n\n\n')
[Link]()
main_menu()
def main_menu():
print('L I B R A R Y M E N U')
print("\n1. Add Books")
print('\n2. Add Member')
print('\n3. Modify Book Information')
print('\n4. Modify Student Information')
print('\n5. Issue Book')
print('\n6. Return Book')
print('\n7. Search Menu')
print('\n\n')
choice = int(input('Enter your choice ...: '))
if choice == 1:
add_book()
if choice == 2:
add_member()
if choice == 3:
modify_book()
if choice == 4:
modify_member()
if choice == 5:
issue_book()
if choice == 6:
return_book()
if choice == 7:
search_menu()
else:
print("Wrong choice...")
def passwd():
ps=input("Enter password:")
if ps=="0604":
main_menu()
else:
print("Wrong password")
passwd()
passwd()
Input And Output
Designs
m
.
Bibliography
Online Sources:
[Link]
[Link]
Reference Books:
Computer Science with Python by Preeti Arora