Skip to content

🏷️ Simplified Library Management System built using Python OOP concepts. Handles book and borrower management, borrowing/returning logic, search, and overdue tracking β€” all using in-memory data structures.

Notifications You must be signed in to change notification settings

Sonydivya/library-management-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ 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

  1. Add Book
  2. Update Book
  3. Remove Book
  4. Add Borrower
  5. Borrow Book
  6. Return Book
  7. Search Books
  8. Show All Books
  9. Show Borrower Borrowed Books / Overdues
  10. 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

About

🏷️ Simplified Library Management System built using Python OOP concepts. Handles book and borrower management, borrowing/returning logic, search, and overdue tracking β€” all using in-memory data structures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages