0% found this document useful (0 votes)
56 views33 pages

CS PROJECT-1 (SNM) 3

Uploaded by

manomani007123
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)
56 views33 pages

CS PROJECT-1 (SNM) 3

Uploaded by

manomani007123
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/ 33

LIBRARY MANAGEMENT

SYSTEM

By -

Sai Santosh
K.R.Narien
M.Manoranjan
LIBRARY MANAGEMENT SYSTEM

INTRODUCTION
A library management system is a software that is designed to

manage all the functions of a library. It helps a librarian to

maintain the database of new books and the books that are

borrowed by members along with their due dates.This system

completely automates all your library's activities. The best way

to maintain, organize, and handle countless books

systematically is to implement a library management system

software.A library management system is used to maintain

library records. It tracks the records of the number of books in

the library, how many books are issued, or how many books

have been returned or renewed or late fee charges, etc.You

can fond books in an instant, issue/reissue books quickly, and

manage all the data efficiently and orderly using this system.

The purpose of a library management system is to provide

instant and accurate data.regarding any type of book, thereby

saving a lot of time and effort


OBJECTIVES OF THE PROJECT

The main objective of the project on the library management

system is to manage the details of the Student, Book Issues,

Librarian, Member. It manages all the information about the

students .The project is totally built at the administrative end

and thus only the administrator is guaranteed the access. The

purpose of the project is to build a web-based application

program to reduce the manual work for managing the

student, books, issues.

● The objective 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 activities of book purchasing, cataloging,

indexing,circulation recording and stock checking are

done by the software. Such software eliminates the need


for repetitive manual work and minimizes the chances of

errors.

● The system saves time for both the user and the librarian.

With just a click the user can search the books available

in the library. The Librarian can answer queries with ease

regarding the availability of books.


PROPOSED SYSTEM

Proposed system is an automated Library Management

System. Through our software user can add members, add

books, search members, search books, update information, edit

information, borrow and return books in quick time. Our

proposed system has the following advantages.

● User friendly interface

● Fast access to database

● Less error

● More Storage Capacity

● Search Facility

● Look and Feel Environment

● Quick transaction

All the manual difficulties in managing the library have

been rectified by implementing computerization.


SYSTEM DEVELOPMENT LIFE CYCLE

The System Development Life Cycle (SDLC) is a process

that is used to design, develop, and maintain software

systems. It consists of several phases, including planning,

analysis, design, implementation, testing, and

maintenance.

● The Library management System shall be required

to maintain information about its users and books.

● It shall store databases for students, teachers, and books.

● The student database stores information about a

student's roll no., Course and year.

● The book database stores information about a book id,

book title, author, publisher and year of publishing.

● The teacher database stores information about a teacher's

id, name, department and designation and telephone

number.
PHASES OF SYSTEM DEVELOPMENT

LIFE CYCLE

1. Planning Phase :

● Before we even begin with the planning stage, the best

tip we can give you is to take time and acquire a

proper understanding of the app development life cycle.

● The planning stage (also called the feasibility stage) is

exactly what it sounds like the phase in which

developers will plan for the upcoming project.

● It helps to define the problem and scope of any existing

systems, as well as determine the objectives for their new

systems.

● By developing an effective outline for the upcoming

development cycle, they'll theoretically catch problems

before they affect development.


● And help to secure the funding and resources they need

to make their plan happen.

● Perhaps most importantly, the planning stage sets the

project schedule, which can be of key importance if

development is for a commercial product that must be

sent to market by a certain time.

7
2. Requirement analysis phase :

● The analysis stage includes gathering all the specifc

details required for a new system as well as determining

the frst ideas for prototypes.

● Developers may:

Defne any prototype system requirements

Evaluate alternatives to existing prototypes

● Perform research and analysis to determine the needs of

end-users Furthermore, developers will ofen create a

sofware requirement specifcation or SRS document.

● This includes all the specifcations for sofware, hardware,

and network requirements for the system they plan to

build. This will prevent them from overdrawing funding

or resources when working at the same place. as other

development teams.

3. Design phase :
● The design stage is a necessary precursor to the main

developer stage. Developers will first outline the details

for the overall application, alongside specific aspects,

such as its:

User interfaces

System interfaces
● Network and network requirements

● Databases:

● They'll typically turn the SRS document they created

● into a more logical structure that can later be

● implemented in a programming language. Operation,

● training, and maintenance plans will all be drawn up

● so that developers know what they need to do

● throughout every stage of the cycle moving forward.

● Once complete, development managers will prepare a

● design document to be referenced throughout the next

● phases of the SDLC.

4. Development phase :

● The development stage is the part where developers

● actually write code and build the application according

● to the earlier design documents and outlined


● specifications.

● This is where Static Application Security Testing tools

● come into play.

● Product program code is built per the design

document specifications. In theory, all of the prior

planning and outlining should make the actual

development phase relatively straightforward.


● Developers will follow any coding guidelines as

defined by the organization and utilize different tools

such as compilers, debuggers, and interpreters.

● Programming languages can include staples such as C++,

PHP, and more. Developers will choose the right

programming code to use based on the project

specification and requirements.

5. Integration and test phase :

● Building software is not the end. Now it must be tested to


make sure that there aren't
any bugs and that the end-user experience will not

negatively be affected at any point.

● During the testing stage, developers will go over their

software with a fine-tooth comb, noting any bugs or

defects that need to be tracked, fixed, and later

retested.

● It's important that the software overall ends up

meeting the quality standards that were previously

defined in the SRS document.


● Depending on the skill of the developers, the complexity

of the software, and the requirements for the end-user,

testing can either be an extremely short phase or take a

very long time.

● After testing, the overall design for the software will


come together.

6. Implementation phase :

The information system will be integrated into its

environment and eventually installed. After passing this stage,

the software is theoretically ready for market and may be

provided to any end-users.

Operation and Maintenance phase :

The SDLC doesn’t end when sofware reaches the market.


Developers must now move into maintenance mode and
begin.
practicing any activities required to handle issues reported by
end-users.
Furthermore, developers are responsible for
implementing any changes that the software might
need after deployment.

This can include handling residual bugs that were not able
to be patched before launch or resolving new issues that
crop up due to user reports. Larger systems may require
longer maintenance stages compared to smaller systems.
REQUIREMENTS

HARDWARE :

practicing any activities required to handle issues reported


by end-users.

Furthermore, developers are responsible for implementing


any changes that the software might need after
deployment.

This can include handling residual bugs that were not able
to be patched before launch or resolving new issues that
crop up due to user reports. Larger systems may require
longer maintenance stages compared to smaller systems.

SOFTWARE :

● Operating System Windows 10

● IDLE Python For Execution Of Program.

● MS Word For Report Presentation.


SOURCE CODE

import mysql.connector as ms

# Connect to the MySQL database

con = ms.connect(host='localhost', user='root',


passwd='name12345', database='library_management')

cur = con.cursor()

def display_options():

"""Displays the available options for the user"""

print("The options are:")

print("1. Add book")

print("2. Search book")

print("3. Remove book")

print("4. Add customer")

print("5. Search customer")

print("6. Remove customer")

print("7. Exit")

def execute_query(query, params=()):

"""Utility function to execute a query and handle the


result"""
cur.execute(query, params)

return cur.fetchall()

# Main loop for the program

while True:

display_options()

try:

# Get user input for option

opt = int(input("Enter the option (1,2,3,4,5,6,7): "))

except ValueError:

print("Invalid input. Please enter a number between 1


and 7.")

continue

if opt == 1: # Add book

def add_book():

bname = input('Enter the book name: ')

Author = input('Enter the author name: ')

try:

bprice = float(input('Enter the price of the book: '))

except ValueError:

print("Invalid price. Please enter a valid number.")


return

bcat = input('Enter the category of the book (Comic,


Story, Novel, Study Guide, Subject): ')

query = "INSERT INTO library (Bname, Author, Price,


Category) VALUES (%s, %s, %s, %s)"

cur.execute(query, (bname, Author, bprice, bcat))

con.commit()

print("Book added successfully.")

add_book()

elif opt == 2: # Search book

def search_book():

cat = input("Enter the category (Bookname, Novel,


Guide, Story, Subject, Comic): ").lower()

if cat == 'bookname':

bname1 = input('Enter book name to search: ')

query = "SELECT * FROM library WHERE Bname


= %s"

results = execute_query(query, (bname1,))

else:
query = "SELECT * FROM library WHERE
Category = %s"

results = execute_query(query, (cat,))

for record in results:

print(record)

search_book()

elif opt == 3: # Remove book

def remove_book():

bname1 = input("Enter the book name to remove: ")

query = "DELETE FROM library WHERE Bname = %s"

cur.execute(query, (bname1,))

con.commit()

print("Book deleted.")

remove_book()

elif opt == 4: # Add customer

def add_cust():

cname = input('Enter the Customer name: ')


bname = input('Enter the book name: ')

try:

bprice = float(input('Enter the price of the book: '))

except ValueError:

print("Invalid price. Please enter a valid number.")

return

bcat = input('Enter the category of the book (Comic,


Story, Novel, Study Guide, Subject): ')

query = "INSERT INTO customer (Cname, Bname,


Price, Category) VALUES (%s, %s, %s, %s)"

cur.execute(query, (cname, bname, bprice, bcat))

con.commit()

print("Customer added successfully.")

add_cust()

elif opt == 5: # Search customer

def search_cust():

cname1 = input('Enter Customer name to search: ')

query = "SELECT * FROM customer WHERE Cname


= %s"
results = execute_query(query, (cname1,))

for record in results:

print(record)

search_cust()

elif opt == 6: # Remove customer

def remove_cust():

cname1 = input('Enter the customer name to delete:


')

query = "DELETE FROM customer WHERE Cname


= %s"

cur.execute(query, (cname1,))

con.commit()

print("Customer deleted.")

remove_cust()

elif opt == 7: # Exit

print("Thank you")

break

else:
print("Invalid option. Please choose a number between 1
and 7.")

# Close the database connection

cur.close()

con.close()

SQL CODE:

CREATE TABLE IF NOT EXISTS library (

Bname VARCHAR(255) NOT NULL,

Author VARCHAR(255) NOT NULL,

Price DECIMAL(10, 2) NOT NULL,

Category VARCHAR(100) NOT NULL,

PRIMARY KEY (Bname)

);

CREATE TABLE IF NOT EXISTS customer (

Cname VARCHAR(255) NOT NULL,

Bname VARCHAR(255) NOT NULL,

Price DECIMAL(10, 2) NOT NULL VARCHAR(100) NOT


NULL,
PRIMARY KEY (Cname, Bname),

FOREIGN KEY (Bname) REFERENCES library(Bname) ON


DELETE CASCADE

);

INSERT INTO library (Bname, Author, Price, Category)

VALUES

('Python for Beginners', 'John Doe', 29.99, 'Programming'),

('The Great Adventure', 'Jane Smith', 19.99, 'Novel'),

('Introduction to Algorithms', 'Thomas H. Cormen', 59.99,


'Study Guide'),

('The Mystery of the Haunted House', 'Mark Twain', 12.99,


'Story'),

('Learn SQL Quickly', 'Alice Johnson', 24.99,


'Programming'),

('Machine Learning Basics', 'David Brown', 49.99,


'Technology'),

('The Art of War', 'Sun Tzu', 9.99, 'History'),

('Moby Dick', 'Herman Melville', 14.99, 'Classic'),

('The Great Gatsby', 'F. Scott Fitzgerald', 11.99, 'Classic'),

('1984', 'George Orwell', 15.99, 'Dystopian'),

('To Kill a Mockingbird', 'Harper Lee', 13.99, 'Classic'),

('Pride and Prejudice', 'Jane Austen', 16.99, 'Romance'),


('War and Peace', 'Leo Tolstoy', 25.99, 'Historical Fiction'),

('The Catcher in the Rye', 'J.D. Salinger', 10.99, 'Fiction'),

('A Brief History of Time', 'Stephen Hawking', 29.99,


'Science'),

('The Hobbit', 'J.R.R. Tolkien', 19.99, 'Fantasy'),

('The Da Vinci Code', 'Dan Brown', 22.99, 'Mystery'),

('The Lord of the Rings', 'J.R.R. Tolkien', 39.99, 'Fantasy'),

('Harry Potter and the Sorcerer\'s Stone', 'J.K. Rowling',


29.99, 'Fantasy'),

('The Secret Garden', 'Frances Hodgson Burnett', 7.99,


'Children'),

('Fahrenheit 451', 'Ray Bradbury', 14.99, 'Dystopian'),

('The Odyssey', 'Homer', 12.99, 'Classic'),

('Sherlock Holmes', 'Arthur Conan Doyle', 18.99, 'Mystery'),

('The Count of Monte Cristo', 'Alexandre Dumas', 21.99,


'Adventure'),

('The Chronicles of Narnia', 'C.S. Lewis', 17.99, 'Fantasy');

-- Insert 25 customers into the 'customer' table

INSERT INTO customer (Cname, Bname, Price, Category)

VALUES

('Alice', 'Python for Beginners', 29.99, 'Programming'),


('Bob', 'The Great Adventure', 19.99, 'Novel'),

('Charlie', 'Introduction to Algorithms', 59.99, 'Study


Guide'),

('David', 'The Mystery of the Haunted House', 12.99,


'Story'),

('Eva', 'Learn SQL Quickly', 24.99, 'Programming'),

('Frank', 'Machine Learning Basics', 49.99, 'Technology'),

('Grace', 'The Art of War', 9.99, 'History'),

('Helen', 'Moby Dick', 14.99, 'Classic'),

('Igor', 'The Great Gatsby', 11.99, 'Classic'),

('Jack', '1984', 15.99, 'Dystopian'),

('Karen', 'To Kill a Mockingbird', 13.99, 'Classic'),

('Liam', 'Pride and Prejudice', 16.99, 'Romance'),

('Mona', 'War and Peace', 25.99, 'Historical Fiction'),

('Nina', 'The Catcher in the Rye', 10.99, 'Fiction'),

('Oscar', 'A Brief History of Time', 29.99, 'Science'),

('Paul', 'The Hobbit', 19.99, 'Fantasy'),

('Quincy', 'The Da Vinci Code', 22.99, 'Mystery'),

('Rachel', 'The Lord of the Rings', 39.99, 'Fantasy'),

('Sam', 'Harry Potter and the Sorcerer\'s Stone', 29.99,


'Fantasy'),

('Tina', 'The Secret Garden', 7.99, 'Children'),


('Ursula', 'Fahrenheit 451', 14.99, 'Dystopian'),

('Victor', 'The Odyssey', 12.99, 'Classic'),


OUTPUT:

1.When adding a book (Option 1):

The options are:

1. Add book

2. Search book

3. Remove book

4. Add customer

5. Search customer

6. Remove customer

7. Exit

Enter the option (1,2,3,4,5,6,7): 1

Enter the book name: Python for Beginners

Enter the author name: John Doe

Enter the price of the book: 29.99

Enter the category of the book (Comic, Story, Novel, Study Guide,
Subject): Programming

Book added successfully.

2. When searching for a book by category (Option 2):

The options are:


1. Add book

2. Search book

3. Remove book

4. Add customer

5. Search customer

6. Remove customer

7. Exit

Enter the option (1,2,3,4,5,6,7): 2

Enter the category (Bookname, Novel, Guide, Story, Subject, Comic):


Programming

('Python for Beginners', 'John Doe', 29.99, 'Programming')

3. When removing a book (Option 3):

markdown

The options are:

1. Add book

2. Search book

3. Remove book

4. Add customer

5. Search customer

6. Remove customer

7. Exit
Enter the option (1,2,3,4,5,6,7): 3

Enter the book name to remove: Python for Beginners

Book deleted.

4. When adding a customer (Option 4):

The options are:

1. Add book

2. Search book

3. Remove book

4. Add customer

5. Search customer

6. Remove customer

7. Exit

Enter the option (1,2,3,4,5,6,7): 4

Enter the Customer name: Alice

Enter the book name: Python for Beginners

Enter the price of the book: 29.99

Enter the category of the book (Comic, Story, Novel, Study Guide,
Subject): Programming

Customer added successfully.


5. When searching for a customer (Option 5):

The options are:

1. Add book

2. Search book

3. Remove book

4. Add customer

5. Search customer

6. Remove customer

7. Exit

Enter the option (1,2,3,4,5,6,7): 5

Enter Customer name to search: Alice

('Alice', 'Python for Beginners', 29.99, 'Programming')

6. When removing a customer (Option 6):

The options are:

1. Add book

2. Search book

3. Remove book

4. Add customer

5. Search customer

6. Remove customer
7. Exit

Enter the option (1,2,3,4,5,6,7): 6

Enter the customer name to delete: Alice

Customer deleted.

7. Exiting the program (Option 7):

The options are:

1. Add book

2. Search book

3. Remove book

4. Add customer

5. Search customer

6. Remove customer

7. Exit

Enter the option (1,2,3,4,5,6,7): 7

Thank you

Sample Invalid Inputs:

Invalid Option:

Enter the option (1,2,3,4,5,6,7): 8

Invalid option. Please choose a number between 1 and 7.

Invalid Price Input (when adding a book or customer):


Enter the price of the book: abc

Invalid price. Please enter a valid number.

Add a new book 2. Search for a book


3. Sell a book for rent
4. Display the books of the selected category
5. Exit
Enter the option: 3
Enter the customer name : Jeeva
Enter the book name : Ponniyin selvan The book is available in novels category
Enter the due date: 12.12.2023
Enter the address of the customer anna nagar
Madurai The book is rented to Jeeva

For option 4 :

The options are:

1. Add a new book

2. Search for a book

3. Sell a book for rent

4. Display the books of the selected category

5. Exit

Enter the option: 4

Enter the category of the book (1. English 2. Maths 3.Science 4. Social Studies
5.Computer Science 6. Novels 7. Story Books 8. Others): 5 The books in Computer
Science category are:
['Learn python', 'learn c++', 'Learn Java', 'Learn C#', 'Learn HTML', 'Learn CSS', 'Learn
Javascript']

You might also like