A comprehensive, file-based Library Management System developed in Python. This project implements a multi-role environment (Admin, Librarian, and Member) with persistent data storage using JSON files.
- Triple-Attempt Login: Users have a maximum of 3 attempts to log in before the system terminates for security.
- Role-Based Access: Distinct menus and permissions for Admins, Librarians, and Members.
- Account Status: Support for
ActiveandInactiveuser accounts.
- Create, Edit, and Delete users (Admins, Librarians, Members).
- Toggle user activity status (Admins are prevented from deactivating themselves).
- Complete oversight of the system's user base.
- Book Management: Add, Update, or Remove books from the catalog.
- Request Handling: Review and Approve/Reject loan, extension, and return requests.
- Inventory Tracking: Automated update of book availability counts upon approval of loans and returns.
- Advanced Search: Search for books by Title, Author, or Category using a flexible keyword system.
- Loan System: Request to borrow books, extend return dates, or notify the librarian of returns.
- Personal Dashboard: View a list of currently borrowed books and their status (Pending/Approved).
- Language: Python 3.x
- Data Persistence: JSON (Users, Books, and Loan records)
- Libraries:
json,datetime
main.py: The entry point of the application.users.json: Stores user credentials, roles, and status.books.json: Stores book details, categories, and inventory counts.loan.json: Stores all transaction records between members and the library.
{
"id": 1,
"title": "The Great Gatsby",
"author": "F. Scott Fitzgerald",
"category": "Fiction",
"available_count": 5
}
Advanced Search Logic
The system uses filter and lambda to search across multiple fields simultaneously:
Python
search_result = list(filter(lambda book:
query in book["title"].lower() or
query in book["author"].lower() or
query in book["category"].lower(), books))
π§ How to Run
Clone the repository:
Bash
git clone [https://github.com/neo-0706/python-project-semester-1.git](https://github.com/neo-0706/python-project-semester-1.git)
Ensure you have Python installed.
Run the application:
Bash
python main.py
π Author
Developed by Mohammad Hosein Shahsavand baghdadi as a first-semester Python project.