Build a Library Management System using Object-Oriented Programming. This project brings together everything from Phase 5 (Modules 041-049).
title,author,isbn,_copies,_availableattributesborrow()— decrements available copies, returns boolreturn_copy()— increments available copies, returns bool@propertyforavailableandcopies__str__,__repr__,__eq__(by ISBN),__hash__
Member(base):name,member_id,borrowed_bookscan_borrow(),borrow_book(),return_book()borrowing_limitproperty returning 0
StudentMember(Member): borrowing_limit = 3, loan_period = 14 daysTeacherMember(Member): borrowing_limit = 10, loan_period = 30 days
name,_books(dict keyed by ISBN),_members(dict keyed by member_id)add_book(book),add_member(member)borrow_book(member_id, isbn),return_book(member_id, isbn)list_books(),list_members()__str__,__len__
- Borrowing when no copies available → RuntimeError
- Borrowing when at limit → RuntimeError
- Returning a book not borrowed → ValueError
- Invalid member or book ID → ValueError
- Open
starter_code.py - Implement each class following the docstrings and type hints
- Test each class as you go
- Run your final solution to verify
Run your solution:
python3 project/starter_code.pyA full solution is available at project/solution/library_system.py.
- Add
search_books(title)orsearch_by_author(author)methods - Add
get_borrowing_history(member_id)with timestamps - Add overdue tracking with fine calculation
- Implement a
Reservablemixin for reserving books - Add data persistence with JSON or a database