![]() |
VOOZH | about |
Library Management System is a project developed using Object-Oriented Programming (OOP) in Python. The goal of this project is to simulate the operations of a real-world library, including adding books, registering users, borrowing and returning books, and searching for books by their title. This system will help manage library resources efficiently and is built around three main components: Books, Users, and the Library itself.
Let's start building the project:
The Book class is responsible for storing and managing details about the books in the library. Each book has a unique identifier, a title, an author, and a quantity representing how many copies are available in the library.
Explanation:
The User class represents a person who borrows books from the library. It stores the user’s information, such as their ID, name, and the list of books they have borrowed. This class also contains methods for borrowing and returning books.
Explanation:
The Library class is the core of the system. It manages both the books and the users. This class is responsible for adding books to the library, registering new users, searching for books, and handling the borrowing and returning of books.
Explanation:
The main function acts as the entry point of the program, where the library system is initialized, books and users are added, and a menu-driven interface allows interaction with the system.
Output:
Welcome to the Library Management System
1. View all books
2. Add books
3. Search for a book by title
4. Borrow a book
5. Return a book
6. View borrowed books
7. Add new User
8. ExitEnter your choice: 7
Enter user id: 3
Enter user's name: Prajjwal
New User added Successfully !!
Welcome to the Library Management System
1. View all books
2. Add books
3. Search for a book by title
4. Borrow a book
5. Return a book
6. View borrowed books
7. Add new User
8. ExitEnter your choice: 4
Enter your user ID: 1
Enter the book ID to borrow: 2
Geek_1 has borrowed 'The Hobbit'
Welcome to the Library Management System
1. View all books
2. Add books
3. Search for a book by title
4. Borrow a book
5. Return a book
6. View borrowed books
7. Add new User
8. ExitEnter your choice: 1
Books in the Library:
ID: 1, Title: Harry Potter and the Philosopher's Stone, Author: J.K. Rowling, Available Quantity: 5
ID: 2, Title: The Hobbit, Author: J.R.R. Tolkien, Available Quantity: 2
ID: 3, Title: 1984, Author: George Orwell, Available Quantity: 2
Welcome to the Library Management System
1. View all books
2. Add books
3. Search for a book by title
4. Borrow a book
5. Return a book
6. View borrowed books
7. Add new User
8. ExitEnter your choice: