ποΈ Library Management System (Python OOP)
π Overview
A console-based Library Management System built in Python using Object-Oriented Programming. This project demonstrates how classes interact to manage books, borrowers, and library operations in a clean, modular way.
π§© Features
π Book Management
β Add, update, and remove books
β Search by title, author, genre, or ISBN
β Track available quantities
π©βπ« Borrower Management
β Add borrowers with name, contact, and membership ID
β Update borrower information
β Track borrowed books with due dates
π Borrow / Return System
β Borrow books if available
β Return books and update stock
β Automatically calculate due dates (14 days)
β Check for overdue books
ποΈ Project Folder Structure
library-management-python/ βββ src/ β βββ book.py # Defines the Book class β βββ borrower.py # Defines the Borrower class β βββ library.py # Defines the Library class (manages system) βββ main.py # Main file - menu-based user interface βββ README.md # Project documentation βββ .gitignore # Files and folders to ignore in Git
βοΈ Installation & Setup Instructions
1οΈβ£ Prerequisites
β Install Python 3.8+
β A terminal or command prompt
2οΈβ£ Clone or Download the Project
git clone https://github.com/your-username/library-management-python.git cd library-management-python
Or download the ZIP file and extract it manually.
3οΈβ£ Run the Application
py main.py
π» Example Menu (When You Run main.py)
Library Menu
- Add Book
- Update Book
- Remove Book
- Add Borrower
- Borrow Book
- Return Book
- Search Books
- Show All Books
- Show Borrower Borrowed Books / Overdues
- Exit Enter choice:
π¬ Example Usage
β Add a Book Enter choice: 1 Title: The Alchemist Author: Paulo Coelho ISBN: ISBN-001 Genre: Fiction Quantity: 3 Book added successfully!
βοΈ Update a Book Enter choice: 2 ISBN to update: ISBN-001 Press Enter to skip a feild New title: The Alchemist (Updated Edition) New author(press Enter to skip): New genre: Classic Fiction New quantity (leave blank to skip): 5 Book details updated successfully!
If the ISBN is not found: Book not found!
β Remove a Book Enter choice: 3 Enter ISBN of book to remove: ISBN-001 Book removed successfully!
If not found: Book not found!
π€ Add a Borrower Enter choice: 4 Name: Divya Contact: 9876543210 Membership ID: M001 Borrower added successfully!
If membership ID already exists the program prints a friendly failure message: Failed to add borrower. Membership ID may already exist.
π Borrow a Book Enter choice: 5 Membership ID: M001 ISBN to borrow: ISBN-002 Borrowed successfully. Due on: 2025-11-26 12:00
On failure (not found / not available): Cannot borrow the book. Check availability or membership ID.
π Return a Book Enter choice: 6 Membership ID: M001 ISBN to return: ISBN-002 Returned successfully!
On failure: Return failed! Check ISBN or membership ID.
π Search for Books Enter choice: 7 Search field (title/author/genre/isbn) [title]: author Query: Paulo Coelho
If no results: No matching books found.
If matches found, prints a line per book: The Alchemist | Paulo Coelho | ISBN-001 | Fiction | copies: 3
π Show All Books If library empty: No books in library.
Otherwise lists each book: The Alchemist (Updated Edition) | Paulo Coelho | ISBN-001 | Classic Fiction | copies: 5 Python Crash Course | Eric Matthes | ISBN-002 | Programming | copies: 2
9 β Show Borrower Borrowed Books / Overdues Enter choice: 9 Enter membership ID to check (leave blank to list all overdues): M001
If borrower has no borrowed books: Borrower Divya has no borrowed books.
If borrower has borrowed books, each line shows status: ISBN-002 | Atomic Habits | due: 2025-11-26 12:00 | Due ISBN-005 | Some Book | due: 2025-10-20 09:00 | OVERDUE
if you press Enter (blank) to list all overdues: If none: No overdue books found.
If there are overdues, each line shows: M001 | Divya | ISBN-005 | Some Book | due: 2025-10-20 09:00
πͺ Exit Enter choice: 0 Goodbye!
π§ Object-Oriented Concepts Used
| Concept | Description ---------------------------------------------------------------------------- |
| Class & Object | Book, Borrower, and Library represent real-world entities. |
| Encapsulation | Each class keeps its own data and methods private to that object. |
| Composition | The Library class contains a list of Book and Borrower objects. |
| Abstraction | The user interacts through simple menu options without seeing internal code. |
| Polymorphism (conceptually) | Methods like __repr__ are customized for clean object printing. |
π§βπ» Author
Name: Divya Pasupuleti Role: Python Developer / Student Description: Passionate about Python and building real-world applications using OOP concepts. GitHub: https://github.com/Sonydivya