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

Cs Projct on Library Management (1)

The document outlines a Computer Science project titled 'Library Management System' completed by Sheetal Upadhyay and team members Priyanka and Rishi for the academic session 2024-25 at JP International School. It includes a detailed description of the project, its objectives, required hardware and software, and the implementation of a digital library system using MySQL and Python. The project aims to streamline library operations through automation, providing functionalities for user enrollment, book management, and reporting.

Uploaded by

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

Cs Projct on Library Management (1)

The document outlines a Computer Science project titled 'Library Management System' completed by Sheetal Upadhyay and team members Priyanka and Rishi for the academic session 2024-25 at JP International School. It includes a detailed description of the project, its objectives, required hardware and software, and the implementation of a digital library system using MySQL and Python. The project aims to streamline library operations through automation, providing functionalities for user enrollment, book management, and reporting.

Uploaded by

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

Jp International

School

Computer Science Project


Session – 2024-25

Name – sheetal upadhay


Team members : Priyanka,
Rishi
Class- 12-b
Roll no. –_____________
project Topic- library Management
Submitted to- Ms. Shikha Agarwal
CERTIFICATE

This is to certify that SHEETAL UPADHYAY has


successfully completed the project titled "Library
Management System" as a part of the curriculum
requirements for the Computer Science program.
The project demonstrates comprehensive knowledge
and application of software development principles,
including database management, user interface
design, and system analysis, in developing a
functional and efficient library management system.
This project was undertaken under the guidance of
Ms. Shikha Agarwal and has met the expectations of
the project requirements.
Date:
Project Supervisor:
Ms. Shikha Agarwal
JP International school
Signature
Acknowledgement

It is with pleasure that I acknowledge my sincere


gratitude to our teacher, Ms. Shikha Agarwal (CS) who
taught and undertook the responsibility of teaching the
subject computer science. I have been greatly benefited
from his classes. I am especially indebted to our Principal
Ms. Ruby chandel who has always been a source of
encouragement and support and without whose inspiration
this project would not have been a successful I would like
to place on record heartfelt thanks to him. Finally, I would
like to express my sincere appreciation for all the other
students for my batch their friendship & the fine time that
we all shared together.
Sheetal upadhyay
12-B
CONTENTS
S.No. TOPIC PAGE
1. Cover page
2. Acknowledgement
3. Hardware and software required
4. Introduction
5. Library
6. Library management system
7. Code for mysql (creating table and database)
8. Main code for library management system
9. Database and table description
10. Executing the code
11. Outputs in mysql
12. Bibliography
HARDWARES AND SOFTWARES REQUIRED

 HARDWARES

1.Desktop Computer / Laptop


2.Mobile Phone

 SOFTWARES

1.Python (Latest Version)


2.MySQL
3.MySQL-Connector-
Python,Requests,Wikipedia-API, Datetime,
Pyfiglet Modules
INTRODUCTION
The project LIBRARY MANAGEMENT SYSTEM
(DIGITAL LIBRARY) includes enrolment of users,
adding of books into the library system. The software has
the facility to search for news, Wikipedia articles. It
includes an authentication facility for admin and user to
login into the admin panel and user panel resp. of the
system. User can see the books available, details of books
issued by the user in the digital library. The Library
Management System can be login using a user ID and
password. It is accessible either by an admin or user.
Only the admin can add, delete and update the data of
users and books into the database. The data can be
retrieved easily. The interface is very user-friendly. The
data are well protected for personal use and makes the
data processing very fast. The purpose of the project
entitled as “DIGITAL LIBRARY” is to computerize the
Front Library Management to develop software which is
user friendly, simple, fast, and cost-effective. It also has a
notes facility where the user can add notes at any point of
the program into the database.
LIBRARY

A library is a collection of books, and possibly other


materials and media, that is accessible for use by its
members and members of allied institutions.
Libraries provide physical or digital materials, and
may be a physical location, a virtual space, or both.
A library's collection normally includes printed
materials which may be borrowed, and usually also
includes a reference section of publications which
may only be utilized inside the premises. Libraries
can vary widely in size and may be organised and
maintained by a public body such as a government,
an institution (such as a school or museum), a
corporation, or a private individual. In addition to
providing materials, libraries also provide the
services of librarians who are trained experts in
finding, selecting, circulating and organising
information while interpreting information needs
and navigating and analysing large amounts of
information with a variety of resources.
LIBRARY MANAGEMENT SYSTEM

(DIGITAL LIBRARY) Library management system


(LMS), is an enterprise resource planning system for
a library, used to track enrolled users, available
books, books issued and to whom, books returned
and it’s fines, etc. The purpose of a library
management system is to operate a library with
efficiency and at reduced costs. The system being
entirely automated streamlines all the tasks involved
in operations of the library. The library management
system software helps in reducing operational costs.
Managing a library manually is labour intensive and
an immense amount of paperwork is involved. The
system saves time for both the user and the librarian.
With just a click the user can search for the books
available in the library. The librarian can answer
queries with ease regarding the availability of books.
Adding, removing or editing the database is a simple
process. Adding new users or cancelling existing
userships can be done with ease. The automated
system saves a considerable amount of time as
opposed to the manual system
DETAILED DESCRIPTION
Our Project has 3 MySQL tables.
These are: -
1.) Books
2.) Issue
3.) Returnbook

1) The table Books contain the following columns:


a) bname
b) author
c) bcode
d) total
e) subject

2.) The table Issue contain the following columns:


a.) name
b.) regno
c.) bcode
d.) issue_date

3.) The table Returnbook contain the following columns:


a.) name
b.) regno
c.) bcode
d.) return_date
:

Create database library_app;

use library_app;

CREATE TABLE Books (


bname VARCHAR(255) NOT NULL, -- Book name
author VARCHAR(255) NOT NULL, -- Author's name
bcode INT PRIMARY KEY , -- Unique book code
total INT NOT NULL, -- Total number of books
subject VARCHAR(100) NOT NULL -- Subject or category of the book);

CREATE TABLE Issue (


-> name VARCHAR(255) NOT NULL, -- Name of the person issuing the book
-> regno VARCHAR(50) NOT NULL, -- Registration number (unique identifier)
-> bcode INT NOT NULL, -- Book code (foreign key referencing Books table)
-> issue_date DATE NOT NULL, -- Date the book was issued
-> PRIMARY KEY (regno, bcode), -- Composite key to prevent duplicate book
issuance
-> FOREIGN KEY (bcode) REFERENCES Books (bcode) -- Foreign key linking to Books
table);

CREATE TABLE Returnbook (


-> name VARCHAR(255) NOT NULL, -- Name of the person returning the book
-> regno VARCHAR(50) NOT NULL, -- Registration number (unique identifier)
-> bcode INT NOT NULL, -- Book code (foreign key referencing Books table)
-> return_date DATE NOT NULL, -- Date the book was returned
-> PRIMARY KEY (regno, bcode), -- Composite key to prevent duplicate entries
-> FOREIGN KEY (bcode) REFERENCES Books(bcode) -- Foreign key linking to Books
table );
Python Source Code
Main Code for Library Management System

import mysql.connector as a
import csv

con = a.connect(host='localhost', user='root', passwd='admin',


database='library_app')

def addbook():
bn = input("Enter Book Name: ")
ba = input("Enter Author's Name: ")
c = int(input("Enter Book Code: "))
t = int(input("Total Books: "))
s = input("Enter Subject: ")
data = (bn, ba, c, t, s)
sql = 'INSERT INTO books VALUES(%s, %s, %s, %s, %s);'
cursor = con.cursor()
cursor.execute(sql, data)
con.commit()
print("\nBook Added Successfully...\n")
wait = input('Press enter to continue...')
main()

def issueb():
n = input("Enter Student Name: ")
r = int(input("Enter Reg No.: "))
co = int(input("Enter Book Code: "))
d = input("Enter Date (YYYY-MM-DD): ")
sql = "INSERT INTO issue VALUES(%s, %s, %s, %s);"
data = (n, r, co, d)
cursor = con.cursor()
cursor.execute(sql, data)
con.commit()
print(f"\nBook issued successfully to: {n}")
bookup(co, -1)
wait = input('Press enter to continue...')
main()

def returnb():
n = input("Enter Student Name: ")
r = int(input("Enter Reg No.: "))
co = int(input("Enter Book Code: "))
d = input("Enter Date (YYYY-MM-DD): ")
sql = "INSERT INTO returnbook VALUES(%s, %s, %s, %s);"
data = (n, r, co, d)
cursor = con.cursor()
cursor.execute(sql, data)
con.commit()
print(f"Book returned by: {n}")
bookup(co, 1)
wait = input('Press enter to continue...')
main()

def bookup(co, u):


sql = "SELECT total FROM books WHERE bcode=%s;"
data = (co,)
cursor = con.cursor()
cursor.execute(sql, data)
result = cursor.fetchone()
if result:
t = result[0] + u
sql = "UPDATE books SET total=%s WHERE bcode=%s;"
data = (t, co)
cursor.execute(sql, data)
con.commit()
else:
print("Book code not found!")
wait = input('Press enter to continue...')
main()

def dbook():
ac = int(input("Enter Book Code: "))
sql = "DELETE FROM books WHERE bcode=%s;"
data = (ac,)
cursor = con.cursor()
cursor.execute(sql, data)
con.commit()
print("Book deleted successfully")
wait = input('Press enter to continue...')
main()

def dispbook():
sql = "SELECT * FROM books;"
cursor = con.cursor()
cursor.execute(sql)
books = cursor.fetchall()
for book in books:
print(f"Book Name: {book[0]}, Author: {book[1]}, Book Code: {book[2]},
Total: {book[3]}, Subject: {book[4]}\n")
wait = input('Press enter to continue...')
main()

def report_issued_books():
sql = "SELECT * FROM issue;"
cursor = con.cursor()
cursor.execute(sql)
issues = cursor.fetchall()
with open("issued_books_report.csv", "w", newline="") as file:
writer = csv.writer(file)
writer.writerow(["Student Name", "Reg No.", "Book Code", "Issue Date"])
writer.writerows(issues)
print("Issued books report generated: issued_books_report.csv")
wait = input('Press enter to continue...')
main()

def report_registered_books():
sql = "SELECT * FROM books;"
cursor = con.cursor()
cursor.execute(sql)
books = cursor.fetchall()
with open("registered_books_report.csv", "w", newline="") as file:
writer = csv.writer(file)
writer.writerow(["Book Name", "Author", "Book Code", "Total",
"Subject"])
writer.writerows(books)
print("Registered books report generated: registered_books_report.csv")
wait = input('Press enter to continue...')
main()

def main():
print("""
LIBRARY MANAGEMENT APPLICATION
---------------------------------------------------------
1. Add Book
2. Issue Book
3. Return Book
4. Delete Book
5. Display Books
6. Generate Reports
7. Exit Program
""")
choice = input("Enter Task No: ")
if choice == '1':
addbook()
elif choice == '2':
issueb()
elif choice == '3':
returnb()
elif choice == '4':
dbook()
elif choice == '5':
dispbook()
elif choice == '6':
print("""
Reports Menu:
1. Issued Books Report
2. Registered Books Report
3. Go Back to Main Menu
""")
report_choice = input("Enter Task No: ")
if report_choice == '1':
report_issued_books()
elif report_choice == '2':
report_registered_books()
elif report_choice == '3':
main()
else:
print("Invalid choice! Returning to main menu...")
main()
elif choice == '7':
print("\nThank you for using the Library Management Application!")
exit()
else:
print("Invalid choice! Please try again...")
main()

main()
Database and table description

Database

Tables
Table books

Table issue

Table returnbook
Execution of code

Adding book
ISSUING BOOK

Returning book
Deleting book

Displaying books
Report menu and viewing issued book

Csv report of issued books


Report menu and viewing total books

Csv report of total books


Exiting program
Total books

Total issued books

Total returned books


Bibliography

 www.python.org
 www.mysql.com
 Computer science with python- Sumita
arora

You might also like