Ip Project
Ip Project
SUBMITTED BY:
SUBMITTED TO: Prikshit Ghangas
Ms. Ashu Bhardwaj
ROLL NO:
CLASS: XII-NM
ACKNOWLEDGEMENt
I would like to express my sincere gratitude to all those
who have helped me in completing this (IP) Project. First
and foremost, I would like to thank my teacher, Ms Ashu
Bhardwaj whose guidance, expertise, and constant
encouragement made this project assignment both
interesting and educational.
I would also like to extend my thanks to my classmates and
peers for their collaborative support and assistance during
the project exercises. Their insights and discussions greatly
enriched my understanding of the subject.
Finally, I would like to thank Rishikul World Academy for
providing the resources and infrastructure necessary to
conduct this project and gain valuable hands-on experience
with Information Practices concepts.
CErtifiCAtE
This is to certify that Prikshit Ghangas has successfully
completed the project assignment for the Information
Practices (IP) course at Rishikul World Academy. The
project was conducted under the guidance of Ms. Ashu
Bhardwaj whose invaluable expertise and encouragement
made this assignment an enriching learning experience.
The project involved the exploration and application of key
concepts in Information Practices, and through this
hands-on experience, the student demonstrated an
understanding of the subject matter.
We appreciate the collaborative efforts of the student's
classmates and peers, whose support contributed to the
success of this project.
02 Objective
03 System Requirements
04 Source Code
05 Output
06 Conclusion
07 Reference
iNtrODUCtiON
Introduction
The Library Management System is a console-based
application built using Python and SQLite, designed to help
manage books, users, and transactions in a library. This
system allows users to:
View all available books
Search for books by title or author
Borrow and return books
Add or remove books
Add new users
View transaction history
The system maintains the following data:
Books: Information about books in the library,
including title, author, and availability status.
Users: Information about the library's users.
Transactions: Records of books borrowed and
returned by users.
Features
1. View Books
This function allows the user to view all books available in
the library. It displays the following information in a table-
like format:
ID: Unique identifier for each book.
Title: Title of the book.
Author: Author of the book.
Available: Availability status of the book (Yes/No).
2. Search for a Book
The user can search for a book by title or author. The
system will display the matching books in a table-like
format. If no books are found, a message indicating "No
books found with the given search term" is displayed.
3. Borrow a Book
The user can borrow a book by providing their name and
the book's ID. The system will check if the book is
available, and if so, it will record the borrowing transaction
and mark the book as unavailable. The borrow date is also
stored in the system.
4. Return a Book
Users can return a borrowed book by providing their name
and the book's ID. If the user has an active borrowing
transaction, the return date is recorded, and the book is
marked as available again.
5. Add or Remove a Book
This function allows the user to either add a new book or
remove an existing one:
Add a Book: The user can provide the title and author
of the book, and the system will add it to the library.
Remove a Book: The user can provide the book's ID to
remove it from the library. If the book is currently
borrowed, it will be removed from the system, but the
transaction history will remain intact.
6. Add a New User
The system allows the addition of new users by entering
their name. This feature helps in maintaining user records
for transactions.
7. Transaction History
Users can view their transaction history, including the
books they borrowed and returned. The history displays the
book's title, borrow date, and return date (if applicable).
OBJECtiVE
The primary objective of this project is to develop an Air
Ticket Booking System that offers a user-friendly
interface for managing flight bookings. The system will
allow users to:
View available flights
Book tickets
Track their booking history
Manage flight details (Admin features)
By integrating Python with SQLite, the system will
demonstrate the practical use of databases in real-world
applications, providing an efficient solution for managing
flight bookings.
SyStEM rEQUirEMENtS
System Requirements for Air Ticket Booking System
1. Hardware Requirements
Processor: Intel i3 or higher (or equivalent)
RAM: Minimum 4GB (8GB recommended for smooth
processing)
Storage: At least 500MB of free space for Python
installation, libraries, and temporary data storage
Operating System: Windows, macOS, or Linux (the
system is platform-independent, as long as Python and
SQLite are supported)
2. Software Requirements
Programming Language: Python 3.6 or higher
Libraries and Dependencies:
o SQLite: For the database to store flight and
booking information
o datetime: For managing booking timestamps and
time-based operations
o os: For managing file paths (used in file operations
like database file handling)
SOUrCE CODE
import sqlite3
from datetime import datetime
# Create tables
cursor.execute('''CREATE TABLE IF NOT EXISTS
books (
book_id INTEGER
PRIMARY KEY,
title TEXT,
author TEXT,
available INTEGER)''')
conn.commit()
conn.close()
conn.close()
conn = sqlite3.connect('library.db')
cursor = conn.cursor()
cursor.execute("SELECT * FROM books WHERE
title LIKE ? OR author LIKE ?", ('%' + search_term + '%',
'%' + search_term + '%'))
books = cursor.fetchall()
if not books:
print("\nNo books found with the given search
term.")
else:
print("\nSearch Results:")
print(f"{'ID':<5} {'Title':<50} {'Author':<25}
{'Available':<10}")
print("-" * 90) # Adjusted width for larger title
for book in books:
status = "Yes" if book[3] else "No"
print(f"{book[0]:<5} | {book[1]:<50} |
{book[2]:<25} | {status:<10}")
conn.close()
conn.close()
conn = sqlite3.connect('library.db')
cursor = conn.cursor()
if transaction:
return_date = datetime.now().strftime("%Y-%m-
%d %H:%M:%S")
cursor.execute("UPDATE transactions SET
return_date = ? WHERE transaction_id = ?", (return_date,
transaction[0]))
cursor.execute("UPDATE books SET available =
1 WHERE book_id = ?", (book_id,))
conn.commit()
print(f"Book returned successfully by
{user_name}!")
else:
print("No active borrowing transaction found for
this book.")
conn.close()
if action == 'A':
title = input("Enter the book title: ")
author = input("Enter the author's name: ")
conn = sqlite3.connect('library.db')
cursor = conn.cursor()
conn.close()
conn = sqlite3.connect('library.db')
cursor = conn.cursor()
conn.close()
else:
print("Invalid choice! Please enter 'A' to add or
'R' to remove a book.")
conn = sqlite3.connect('library.db')
cursor = conn.cursor()
conn = sqlite3.connect('library.db')
cursor = conn.cursor()
cursor.execute("SELECT books.title,
transactions.borrow_date, transactions.return_date "
"FROM transactions JOIN books
ON books.book_id = transactions.book_id "
"WHERE transactions.user_name
= ?", (user_name,))
transactions = cursor.fetchall()
conn.close()
Viewing Flights :-
Available Flights:
Flight ID | Airline | From | To | Departure
| Arrival | Price
1 | Air India | Delhi | Mumbai | 10:00
| 12:00 | 5000.0
2 | IndiGo | Mumbai | Chennai | 14:00
| 16:30 | 4000.0
3 | SpiceJet | Bangalore| Kolkata | 18:00
| 21:00 | 4500.0
Booking a Ticket :-
Enter your name: John Doe
Available Flights:
Flight ID | Airline | From | To | Departure
| Arrival | Price
1 | Air India | Delhi | Mumbai | 10:00
| 12:00 | 5000.0
2 | IndiGo | Mumbai | Chennai | 14:00
| 16:30 | 4000.0
3 | SpiceJet | Bangalore| Kolkata | 18:00
| 21:00 | 4500.0
Enter the Flight ID you want to book: 2
Booking successful!
Viewing Bookings :-
Your Bookings:
Booking ID | Name | Flight ID | Date
1 | John Doe |2 | 2024-12-18
14:30:00
Exit :-
Exiting the system. Thank you!
CONCLUSiON
The Library Management System project effectively
demonstrates the integration of Python programming and
SQL database management to create a comprehensive
solution for managing library operations. By offering
features like adding and removing books, borrowing and
returning books, and viewing book transactions, this project
provides valuable hands-on experience with database
management, Python programming, and real-world
software development concepts.
This project serves as an excellent learning tool for
understanding how technology can simplify and streamline
library management processes. It showcases how to handle
structured data, manage user interactions, and automate
tasks like cataloging books and tracking transactions.
Furthermore, it highlights the importance of creating
efficient and user-friendly systems for everyday operations
in institutions like libraries.
In addition to its educational value, the Library
Management System serves as a foundational framework
for more advanced features that could be added in the
future, such as integrating user authentication, generating
reports, or creating a web-based interface. The project
demonstrates the potential of Python and SQL in creating
scalable and adaptable solutions that can be applied to real-
world problems in educational and organizational settings.
Overall, this project exemplifies how a well-designed
software system can optimize daily tasks, making it an
essential tool for managing library resources and improving
user experience.
rEfErENCES
The data used in the Library Management System project
is fictional and created for educational purposes. Below is a
breakdown of the data sources and inspirations used in the
development of the system:
Book Information
1. Book titles, authors, genres, and publication dates
were designed as sample data to demonstrate the
functionality of the system.
2. These details do not correspond to real books or
authors but are intended to simulate a typical
library database.
Database Design
1. The database schema (tables for books, users, and
transactions) was structured based on common
practices in library management systems, inspired
by resources from platforms such as W3Schools,
Real Python, and various SQL tutorials.
2. The relational design ensures that data integrity and
efficiency are maintained while enabling flexible
queries for managing book transactions.
Transaction Details
1. User-provided inputs, such as book
borrowing/returning and user information, are
collected during runtime and stored dynamically in
the SQLite database.
2. The project’s workflow mimics real-world library
operations like checking out books and tracking
their return dates.
The purpose of this project is to demonstrate the integration
of Python and SQL in creating a functional library
management system. All data used in this system is
fictional and intended for simulation and educational
purposes only. For real-world use, the dataset can be
customized to include actual library books and user
information.
If you need help integrating real-world data or modifying
the system to suit specific requirements, feel free to reach
out!