0% found this document useful (0 votes)
18 views19 pages

CS Project 2024-25

Uploaded by

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

CS Project 2024-25

Uploaded by

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

-:Introduction:-

Members of the group:-


1. Priyansh Gandhi
2. Harshil Sheth
3. Ayush Shrimali

Name Of The Subject:-Computer Science

Name of the Project:-

Library management system

1 | Page
-:INDEX:-

Sl.No TOPIC PAGE NO

1. about the Project 3

2. System Requirements 4

3. Program Code 5-11

4. Output 12-14

5. Flowchart 15

6. Validation 16

7. Limitations 17

8. Acknowledgement 18

9. Certificate 19

-:ABOUT THE PROJECT:-

2 | Page
The Library Management System is a simple console-based application implemented in
Python designed to streamline the management of library resources and enhance
user experience. This project focuses on providing essential features that facilitate
efficient book handling and tracking within a library setting.

Key Features:

1. Add New Books: Librarians can easily input details of new titles into the
system, including title, author, ISBN, and genre, ensuring that the library's
collection is always up-to-date.
2. Remove Any Book: The system allows for quick removal of books that are
outdated, damaged, or no longer in circulation, helping maintain an
organized library inventory.
3. Issue Book to Student: The application enables seamless book issuance to
students by tracking borrower details and ensuring that all issued books are
logged for accountability.
4. Return Book: Users can return books effortlessly, with the system updating
the inventory and marking the book as available for other borrowers.
5. View Available Books: Librarians and users can access a comprehensive
list of all available books, complete with search and filter options, making it
easy to find desired titles.
6. View Issued Books: The system provides an overview of all currently
issued books, allowing librarians to monitor due dates and manage late
returns effectively.

-:SYSTEM REQUIREMENTS:-

3 | Page
Hardware requirements:-
1. Computer:
Modern computer capable of running python should be sufficient. More powerful
hardware might be necessary for resource intensive 3D games
2. Graphics Card:

3. Memory(RAM):
The amount of RAM depends on the complexity of the project. At least 4GB is
recommended, and more for larger projects.

Software requirements:-
1. Python:
• Ensure that Python is installed on your system. You can download and install Python
from the official Python website .
2. Operating System:
• The code is designed to be platform-independent and should work on any operating
system that supports Python, including Windows, macOS, and Linux.
3. Console/Command Prompt:
• The code is executed in a console or terminal environment. Ensure that your
operating system provides a functioning command-line interface.
4. MySQL:
Ensure that MySQL is installed on your system. You can download MySQL from
www.mysql.org

-:Program Code:-

4 | Page
# Library Management System

print ("""

______________

Welcome to Library Management System

_______________

""")

import pymysql

mydb = pymysql. Connect(host="localhost", user="root", password="1234",


port=3306)

mycursor = mydb.cursor()

# Creating Database

mycursor.execute("CREATE DATABASE IF NOT EXISTS library_3")

mycursor.execute ("USE library_3")

mycursor.execute("CREATE TABLE IF NOT EXISTS available_books(id INT, name


VARCHAR(25), subject VARCHAR(25), quantity INT)")

mycursor.execute("CREATE TABLE IF NOT EXISTS issued(id INT, name


VARCHAR(25), subject VARCHAR(25), s_name VARCHAR(25), s_class
VARCHAR(25))")

mycursor.execute("CREATE TABLE IF NOT EXISTS login(user VARCHAR(25),


password VARCHAR(25))")

mydb.commit()

# Check for existing login entry

flag = 0

5 | Page
mycursor.execute("SELECT * FROM login")

for i in mycursor:

flag = 1

if flag == 0:

mycursor.execute("INSERT INTO login VALUES('user', 'ng')")

mydb.commit()

# Main loop

while True:

print("1. Login 2. Exit")

try:

ch = int(input("Enter your choice: "))

except ValueError:

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

continue

if ch == 1:

pas = input("Enter password: ")

mycursor.execute("SELECT * FROM login")

for i in mycursor:

t_user, t_pas = i

if pas == t_pas:

print("Login Successful")

loop1 = 'n'

6 | Page
while loop1 == 'n':

print("""

________

1. Add New Books

2. Remove Any Book

3. Issue Book to Student

4. Return Book

5. View Available Books

6. View Issued Books

7. Logout

________

""")

try:

ch = int(input("Enter your choice: "))

except ValueError:

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

continue

if ch == 1: # Add new books

loop2 = 'y'

while loop2 == "y":

print("All information is mandatory to be filled!")

7 | Page
idd = int(input("Enter book ID: "))

name = input("Enter book name: ")

subject = input("Enter subject: ")

quantity = int(input("Enter quantity: "))

mycursor.execute(f"INSERT INTO available_books VALUES ({idd},


'{name}', '{subject}', {quantity})")

mydb.commit()

loop2 = input("Do you want to add more books? (y/n): ").lower()

elif ch == 2: # Remove any book

idd = int(input("Enter book ID to remove: "))

mycursor.execute(f"DELETE FROM available_books WHERE id =


{idd}")

mydb.commit()

print(f"Book with ID {idd} removed successfully.")

elif ch == 3: # Issue book to student

idd = int(input("Enter book ID: "))

mycursor.execute(f"SELECT * FROM available_books WHERE id =


{idd}")

book = mycursor.fetchone()

if book:

name, subject, quantity = book[1], book[2], book[3]

if quantity > 0:

s_name = input("Enter student name: ")

8 | Page
s_class = input("Enter student class: ")

mycursor.execute(f"INSERT INTO issued VALUES ({idd}, '{name}',


'{subject}', '{s_name}', '{s_class}')")

mycursor.execute(f"UPDATE available_books SET quantity =


quantity - 1 WHERE id = {idd}")

mydb.commit()

print("Book issued successfully.")

else:

print("No more copies available to issue.")

else:

print("Book not found.")

elif ch == 4: # Return book

idd = int(input("Enter book ID to return: "))

s_name = input("Enter student name: ")

s_class = input("Enter student class: ")

mycursor.execute(f"SELECT * FROM issued WHERE id = {idd} AND


s_name = '{s_name}' AND s_class = '{s_class}'")

issued_book = mycursor.fetchone()

if issued_book:

mycursor.execute(f"DELETE FROM issued WHERE id = {idd} AND


s_name = '{s_name}' AND s_class = '{s_class}'")

mycursor.execute(f"UPDATE available_books SET quantity =


quantity + 1 WHERE id = {idd}")

9 | Page
mydb.commit()

print("Book returned successfully.")

else:

print("No record of this book being issued.")

elif ch == 5: # View available books

mycursor.execute("SELECT * FROM available_books")

print("ID | NAME | SUBJECT | QUANTITY")

for i in mycursor:

print(f"{i[0]} | {i[1]} | {i[2]} | {i[3]}")

elif ch == 6: # View issued books

mycursor.execute("SELECT * FROM issued")

print("ID | NAME | SUBJECT | STUDENT NAME | CLASS")

for i in mycursor:

print(f"{i[0]} | {i[1]} | {i[2]} | {i[3]} | {i[4]}")

elif ch == 7: # Logout

break

else:

print("Wrong Password.")

elif ch == 2: # Exit

print("Exiting...")

break

else:

10 | Page
print("Invalid choice. Please select a valid option.")

:-OUTPUTS:-

11 | Page
12 | Page
13 | Page
14 | Page
-:FLOWCHART:-

15 | Page
-:VALIDATION:-

. Ensure that user inputs are of the expected type (e.g, integers,
strings ,etc.)

. Validate input ranges to prevent out-of-bounds values.

. Check for required fields and handle missing inputs appropriately.

. Implement data type validation to avoid unexpected data types.

16 | Page
-:LIMITATIONS:-

While the provided code is a simple implementation of a to-do list program, it has some
limitations that the user might want to consider:
.

1. No Input Validation:
• The code assumes that the user will always enter valid input. There is no input
validation or error handling for cases where the user might enter unexpected input.
For example, entering a non-numeric value when prompted for a choice could cause
the program to crash.

2. Single User Interaction:


• This program is designed for a single user. If you want to make it multi-user, you
would need to implement a way to differentiate between users and manage their
individual to-do lists.

3. No User Authentication:
• If the program is intended for multiple users, there is no user authentication in place.
Adding user authentication would be necessary for a more secure and personalized
experience.

4. Limited User Interface:


• The command-line interface might not be the most user-friendly option, especially if
you plan to expand the program. Consider using a graphical user interface (GUI) for
a more intuitive user experience.

17 | Page
-:ACKNOWLEDEGEMENT:-
I would like to express my heartfelt gratitude to my computer science teacher Mrs. Arpita
Sengupta for her guidance, support, and encouragement throughout the development of
the to-do list program. her insights and feedback have been invaluable in shaping this
project and enhancing my programming skills.

I would also like to extend my appreciation to Ma’am Lovleen Sehgal, our principal, for
fostering an environment that encourages creativity and learning. Your leadership has
played a crucial role in creating a positive and innovative atmosphere within our school.

Additionally, I want to acknowledge the contributions of my team members who provided


assistance and collaborated on various aspects of the project. Their dedication and
teamwork have been instrumental in bringing this to-do list program to fruition.

Thank you all for being a constant source of inspiration and for fostering an environment
that promotes growth and learning.

18 | Page
19 | Page

You might also like