A comprehensive console-based Library Management System built using Python. This project features a modular architecture, Object-Oriented Programming (OOP) principles, local JSON file handling, automated fine calculation, member approvals, reservations, and renewals.
- Dual Portal Access:
- Member Portal: View available/searched books, borrow, renew, reserve, and view personal accounts/fines.
- Admin / Librarian Portal: Manage books, view all records, approve/reject new member requests, freeze/unfreeze accounts, and clear fines.
- Member Management & Workflow:
- Self-registration system with auto-assigned Member IDs and Admin approval workflow (
Pending->Active). - PIN authentication with SHA-256 hashing and automatic Account Freezing after 3 failed attempts.
- Self-registration system with auto-assigned Member IDs and Admin approval workflow (
- Book & Inventory Management (CRUD):
- Add, update, delete, and view books with stock status tracking.
- Smart search and filtering by Title, Author, Category, or Available-only status.
- Borrowing, Renewal & Reservation:
- Automated 7-day borrowing period with issue and due date tracking.
- Book Renewal: Extend due dates by another 7 days (if not overdue or reserved).
- Book Reservation: Reserve currently borrowed books so you get priority upon return.
- Automated Fines & Transaction Slips:
- Automatic late fine calculation (Rs. 100/day past due date).
- Auto-generation of text receipt files (
receipts/folder) for borrows, returns, and fine payments.
- Advanced Reporting:
- Defaulters Report: Instant itemized list of members with unpaid fines and overdue books.
- Top Borrowed Books Report: Tracks book demand and popularity based on borrow counts.
- Transaction History: Complete log of all library actions.
- Language: Python 3
- Data Storage: JSON File Handling (
data/) - Key Concepts:
- Object-Oriented Programming (Classes, Objects, Encapsulation, Static Methods)
- Modular Architecture (
src/models.py,src/manager.py,src/ui.py,src/utils.py) - Security & Hashing (
hashlibfor PIN security) - Date & Time Operations (
datetime,timedelta) - Exception Handling & Robust Input Validation
Library-Management-System/
│
├── main.py # Application entry point
├── src/
│ ├── __init__.py
│ ├── models.py # Book, Member, Transaction classes
│ ├── manager.py # Business logic and file storage handler
│ ├── ui.py # CLI menus and user interaction
│ └── utils.py # Helper validation functions
├── data/
│ ├── books.json # Book records storage
│ ├── members.json # Member accounts & credentials
│ └── transactions.json # Complete transaction logs
├── receipts/ # Auto-generated TXT slips (Borrows, Returns, Fines)
├── .gitignore # Git ignore rules
└── README.md # Project documentation
- Clone the repository:
git clone [https://github.com/osaid400/Library-Management-System.git](https://github.com/osaid400/Library-Management-System.git)
- Navigate to the project directory:
cd Library-Management-System
- Run the program:
python main.py
=========================================
LIBRARY MANAGEMENT SYSTEM
=========================================
1. Student / Member Login
2. Request New Member Registration
3. Librarian / Admin Portal
0. Exit
=========================================
Select Option (0-3): 3
Enter Admin Secret PIN: **********
=============================================
LIBRARIAN / ADMIN PANEL
=============================================
1. Add New Book
2. Update Book
3. Delete Book
4. View All Books
5. View All Members
6. Pending Member Approval Requests
7. Freeze / Unfreeze Member Account
8. Clear Member Fine
9. Defaulters Report
10. Top Borrowed Books Report
11. View All Transactions
0. Back to Main Menu
=============================================
Enter choice (0-11): 4
========================================================================================================
ID Title Author Category Status Reserved
========================================================================================================
101 Python Crash Course Eric Matthes Programming Borrowed No
102 Clean Code Robert C. Martin Programming Available Yes (1002)
103 Atomic Habits James Clear Self Help Available No
=========================================================================================================
=============================================
WELCOME, ABDULLAH (ID: 1001)
=============================================
1. View Available Books
2. Search Books
3. Borrow Book
4. Renew Borrowed Book
5. Reserve Unavailable Book
6. Return Book
7. My Account / Borrowed Books & Fine
0. Logout
=============================================
Enter choice (0-7): 3
Enter Book ID to borrow: 102
Successfully borrowed 'Clean Code'. Due Date: 10-08-26
================================================================================
DEFAULTERS REPORT
================================================================================
Member ID : 1001
Name : Abdullah
Unpaid Fine : Rs. 200.00
Overdue Books:
- [101] Python Crash Course (2 days late, fine: Rs. 200.00)
--------------------------------------------------------------------------------
- CSV / Excel Report Exporting: Allow admins to export transaction logs and defaulter lists directly to CSV files for external audits.
- Email Notification System: Automated email alerts sent to members regarding upcoming due dates, fine updates, and approval statuses.
- Multi-Copy Book Inventory: Support tracking multiple physical copies of the same book title instead of limiting unique entries to single copies.
- Graphical User Interface (GUI): Build a cross-platform desktop application interface using PyQt or Tkinter.
- Database Integration: Migrate from local JSON storage to a robust relational database engine like SQLite or MySQL.
MUHAMMAD ABDULLAH FAROOQ