CS Project Final
CS Project Final
Submitted by:
Animesh Kumar
Class 12th
Subject : Computer Science
Submitted to :
Shishir Pandey Sir
Computer Science Teacher
Date of submission :
1
Certificate
Date: ____________________
2
Acknowledgment
I would also like to thank my friends Archit and shourya, who have
been a great source of motivation and help. Whether it was
discussing ideas, helping with debugging, or just being there when I
needed a break, their support made the process more enjoyable and
manageable. I appreciate the teamwork and friendship that helped
me stay on track.
3
Contents
1. Introduction
2. Objective
3. Technology used
5. System design
6. Code explanation
7. Screenshots
8. Conclusion
9. Bibliography
4
Introduction
5
Objective
Manage book records: Store and organize details of all books in the
library, including their titles, authors, publication dates, and
availability status.
Issue and return books: Allow the librarian to issue books to users
and record the details, such as the issue date, return date, and the
user’s information. Similarly, the system will also handle book
returns and update the records accordingly.
6
Technology Used
This project was developed using the following technologies :
1.Python
~Modules used
.mysql.connector: This is the library I used to connect Python to
my MySQL database.
2.MySQL
To manage all the data for the library (like book records and user
details), which will be stored on the database server of MySQL.
7
3.Pydroid
4.Termux
8
Hardware and Software Used
9
System Design
Key Features from the Code :
1. Database Setup:
○ You create a database called library and set up three tables:
available_books, issued, and login.
○ The available_books table stores details about books like
their ID, name, subject, and quantity.
○ The issued table tracks which books are issued, along with
student details.
○ The login table is used for user authentication with a
default user setup (user, 1234).
2. Login System:
○ The user has to log in using a password to access the main
menu. By default, the password is "1234".
3. Main Menu Options:
After logging in, the user can choose from several options:
○ Add New Books: Adds a new book to the available_books
table.
○ Remove Books: Deletes a book by its ID from the
available_books table.
○ Issue Books: Issues a book to a student by reducing its
quantity and adding it to the issued table.
10
○ Return Books: Returns a book by increasing its quantity
in the available_books table and removing it from the
issued table.
○ View Available Books: Displays all the books available in
the library.
○ View Issued Books: Shows a list of all issued books and
the students who borrowed them.
4. Exiting:
You have the option to log out or exit the system at any time.
11
Code explanation
1. Database Setup
The first thing the program does is connect to a MySQL
database. If the database doesn't exist, it creates one called
library. Inside this database, we have three tables:
○ available_books: This table stores information about the
books in the library, such as the book’s ID, name, subject,
and the number of copies available.
○ issued: This table keeps track of which books have been
issued to which students, including the student's name
and class.
○ login: This table handles user login credentials. There’s a
default username (user) and password (1234) set up to get
started.
12
2. Login System
Before you can access the main system, you need to log in. The
default password is 1234, which is checked against the login
table. Once you’re logged in, you can start managing the
library.
3. Main Menu
After logging in, you’ll see a menu with seven options. Here’s
what each option does:
○ 1. Add New Books: This option lets you add new books
to the library. You’re asked to provide details like the
book's ID, name, subject, and the number of copies.
Once the information is entered, it’s saved in the
available_books table.
○ 2. Remove Books: If you want to remove a book, you can
provide its ID, and the program will search for that book
in the available_books table. If the book is found, it’s
deleted.
○ 3. Issue Book to Student: This option allows you to issue
a book to a student. You enter the book’s ID, and the
program checks if it’s available. If it is, it decreases the
number of available copies by 1 and saves the student’s
details in the issued table.
13
○ 4. Return Book: When a student returns a book, you can
use this option to update the system. The book’s quantity
is increased by 1, and the record is removed from the
issued table.
○ 5. View Available Books: This simply displays all the
books currently available in the library.
○ 6. View Issued Books: This shows you which books have
been issued and to which students.
○ 7. Logout: This option logs you out of the system.
4. Error Handling
The code also has some error handling to make sure things go
smoothly. For example, if you try to remove or issue a book
that doesn’t exist, or if you enter an invalid input (like a letter
when a number is expected), the program will notify you.
5. User-Friendly Interface
The program uses the tabulate library to neatly format the data
in tables, making it easier to view lists of books and issued
records.
14
Code
15
16
17
18
19
Tables created in MySQL
Table : available_books
Table : issued
Table : login
20
Conclusion
I’ve come out of this project with improved coding skills and a better
understanding of how to build practical applications. I’m excited to
take what I’ve learned and apply it to even bigger projects in the
future.
21
Bibliography
Main Source
Book : Computer Science with Python by Sumita Arora
Python Documentation
Official Python documentation for learning Python syntax and
libraries.
URL : https://docs.python.org/3/
MySQL Documentation
For understanding MySQL database management and queries.
URL : https://dev.mysql.com/doc/
Termux Wiki
For setting up MySQL on Android devices using Termux.
URL : https://wiki.termux.com/wiki/Main_Page
22