# -*- coding: utf-8 -*- from Book import Book from Catalog import Catalog from User import Member, Librarian librarian = Librarian("Awantik", "Bangalore", 34, 'asljlkj22', 'zeke101') book1 = librarian.addBook('A novel', 'Ashish Kaul', 2020, 242) book2 = librarian.addBook('Moonwalking with Einstien', 'J Foer', 2017, 318) book3 = librarian.addBook('I heard you paint houses', 'Charles Brandt', 2004, 338) librarian.addBookItem(book1, '101hg', 'H1A1') librarian.addBookItem(book1, '102hg', 'H1A2') librarian.addBookItem(book1, '103hg', 'H1A3') librarian.addBookItem(book2, '201hg', 'H1B1') librarian.addBookItem(book2, '202hg', 'H1B2') librarian.addBookItem(book3, '301hg', 'H1C1') librarian.addBookItem(book3, '302hg', 'H1C2') # librarian.removeBookFromCatalog('A novel') # librarian.removeBookItem('A novel', '102hg') librarian.displayAllBooks() member1 = Member("Ashish", "Bangalore", 23, 'asljlkj22', 'std1233') # print(member1.searchByAuthor('J Foer')) # member1.displayAllBooks()
catalog.searchByName('Shoe Dog') catalog.searchByAuthor("Phil Knight") catalog.searchByPublishDate("2015") catalog.searchBookByMinPages(300) catalog._removeBook("Shoe Dog") catalog.displayAllBooks() print("\n\n") sys.stdout.flush() print("Testing User.py:", "\n") print("\n") print("Testing Librarian and its functions:", "\n") librarian = Librarian("Awantik", "Bangalore", 34, 'asljlkj22', 'zeke101') print(librarian) librarian.addBook('Shoe Dog', 'Phil Knight', '2015', 312) librarian.addBookItem("Shoe Dog", '123hg', 'H1B2') librarian.addBookItem("Shoe Dog", '124hg', 'H1B4') librarian.addBookItem("Shoe Dog", '125hg', 'H1B5') librarian.addBook('Moonwalking with Einstien', 'J Foer', '2017', 318) librarian.addBookItem('Moonwalking with Einstien', '463hg', 'K1B2') librarian.addBookItem('Moonwalking with Einstien', '466hg', 'K1B5') librarian.displayAllBooks() librarian.removeBookItemFromCatalog("125hg") librarian.displayAllBooks() librarian.removeBook("Shoe Dog") librarian.displayAllBooks() librarian.addBook('Shoe Dog', 'Phil Knight', '2015', 312) librarian.addBookItem("Shoe Dog", '123hg', 'H1B2') librarian.addBookItem("Shoe Dog", '124hg', 'H1B4') librarian.addBookItem("Shoe Dog", '125hg', 'H1B5') librarian.displayAllBooks()
from Book import Book from Catalog import Catalog from User import Member, Librarian catalog = Catalog() #reference to Librarian class object librarian = Librarian("Awantik","Bangalore",34,'asljlkj22','zeke101') #details of librarian print (librarian) # adding a book by librarian b2 =librarian.addBook("This is Going to Hurt: Secret Diaries of a Junior Doctor","Adam Key",'2017', 302,catalog) #adding details librarian.addBookItem(b2,'234c','l203',catalog) #displaying all the books till now added librarian.displayAddedBook(catalog) #library remove book librarian.removeBook('Shoe Dog',catalog) librarian.addBookItem(b2,'235c','1204',catalog) librarian.removeBookItemFromCatalog(catalog,"This is Going to Hurt: Secret Diaries of a Junior Doctor",'235c')
# -*- coding: utf-8 -*- from User import Member from User import Librarian lib = Librarian("Naveen", "AP", 22, "AA123", "EMP123") print(lib) lib.addBook('Shoe Dog','Phil Knight', "2015",400) lib.addBookItem("Shoe Dog", "isbn1", "H1B1") lib.addBookItem("Shoe Dog", "isbn3", "H1B2") lib.displayAllBooks() lib.addBook('Progrmming','imran khan', "1999",500) lib.addBookItem("Progrmming", "isbn4", "H1C1") lib.addBookItem("Progrmming", "isbn6", "H1C2") lib.displayAllBooks() lib.addBook('Python','reema thareja', "200",320) lib.addBookItem("Python", "isbn7", "H1D1") lib.addBookItem("Python", "isbn9", "H1D2") lib.displayAllBooks() lib.removeBook("Python") lib.displayAllBooks() lib.removeBookItemFromCatalog("isbn1") lib.displayAllBooks() m1 = Member("Sharma", "Ap", 20, "AA990", "STUID112") print(m1)
from User import Member from User import Librarian lib = Librarian('Gopal', 'Indore', 24, '994400555515', 'GOP975') print(lib) lib.addBook('Thermodynamics', 'P.K. Nag', 'June 1989', '1279') lib.addBookItem('Thermodynamics', 'BTXPB5929C', 'T101') lib.addBookItem('Thermodynamics', 'BTXPB5929C', 'T102') lib.addBook('Machine Design', 'R.S. Khurmi', 'Februaru 1990', '2087') lib.addBookItem('Machine Design', 'CDFTC6432B', 'M201') lib.addBookItem('Machine Design', 'CDFTC6432B', 'M201') lib.addBook('Theory of Machines', 'Dr. A.G. Ambekar', 'September 1985', '2745') lib.addBookItem('Theory of Machines', 'SMNQS6664A', 'TM301') lib.addBookItem('Theory of Machines', 'SMNQS6664A', 'TM302') lib.viewBooks() lib.removeBookItem('SMNQS6664A') lib.viewBooks() lib.removeBook('Theory of Machines') lib.viewBooks() member1 = Member('Aditya', 'Indore', 24, '9424534453', 'ADI942') member2 = Member('Harish', 'Indore', 25, '9791457862', 'HAR979') print(member2) member1.viewBooks() member1.reserveBook('Thermodynamics') member2.reserveBook('Machine Design') member1.viewBooks() lib.viewissuedBookItems() lib.viewIssuerInfo()
catalog.displayAllBooks() # removing book item catalog.removeBookItem('Shoe Dog', '124hg') catalog.displayAllBooks() # serching a book b = catalog.searchByName('Shoe Dog') print(b) #librarian object librarian = Librarian("Awantik", "Bangalore", 34, 'asljlkj22', 'zeke101') # librarian adding book l = librarian.addBook(catalog, 'How to write clean code', 'David', '2020', 150) l1 = Book('How to write clean code', 'David', '2020', 150) # librarian adding book items librarian.addBookItem(l, '1234hg', 'H1B2') librarian.addBookItem(l, '1235hg', 'H1B2') catalog.displayAllBooks() # librarian removing bookitem we need to paas class object for calling class methods librarian.removeBookItemFromCatalog(catalog, l1, 'How to write clean code', '1234hg') # librarian removing book librarian.removeBook(catalog, 'Shoe Dog') # memeber Object m1 = Member("Vish", "Bangalore", 23, 'asljlkj22', 'std1233') # member is issuing book and then system will update our inventory m1.issueBook(catalog, b1, 'Shoe Dog') catalog.displayAllBooks() # when member returns a book,then system will update our inventory
from User import Member, Librarian lib = Librarian("Sumit yadav", "Mumbai", 30, "PUNE199", "JSPM1111") print(lib) lib.addBook("Crack IELTS", "Pravin Choudhari", "2015") lib.addBookItem("Crack IELTS", "001aa", "B1") lib.addBookItem("Crack IELTS", "002aa", "B2") lib.addBook("Crack coding round", "Saurabh Jadhav", "2002") lib.addBookItem("Crack coding round", "001ab", "C1") lib.addBookItem("Crack coding round", "002ab", "C2") lib.addBook("Theory of everything", "Stephen hawking", "2012") lib.addBookItem("Theory of everything", "001ac", "D1") lib.addBookItem("Theory of everything", "002ac", "D2") lib.addBookItem("Theory of everything", "003ac", "D2") lib.viewBooks() lib.removeBookItem("001ac") lib.viewBooks() lib.removeBook("Crack coding round") lib.viewBooks() member1 = Member("Ashwani Devesh Kashyap", "Mumbai", 23, "ADK4321", "NESS4321") member2 = Member("Shivani Kashyap", "Surat", 19, "SK1234", "MSU8765") member3 = Member("Navneet Kashyap", "Patna", 21, "NK9876", "JSPM1715") print(member1) print(member2) print(member3) member1.viewBooks() member1.search_by_book_name("Theory of everything") member1.search_by_book_name("The magic of thinking big")
# -*- coding: utf-8 -*- """ Created on Fri Jan 10 14:45:46 2020 @author: ali """ from User import Member from User import Librarian lib = Librarian("John Doe", "Mumbai", 30, "AJSK8549", "EMP58964") print(lib) lib.addBook('Shoe Dog', 'Phil Knight', "Biography", '2015') lib.addBookItem("Shoe Dog", "123pk", "H1B1") lib.addBookItem("Shoe Dog", "124pk", "H1B2") lib.addBook('Kafka On The Shore', 'Haruki Murakami', "Fiction", "2002") lib.addBookItem("Kafka On The Shore", "854hm", "C1B1") lib.addBookItem("Kafka On The Shore", "685hm", "C1B2") lib.addBook('The Fault In Our Stars', 'John Green', "Romance", "2012") lib.addBookItem("The Fault In Our Stars", "957jg", "R1B1") lib.addBookItem("The Fault In Our Stars", "985jg", "R1B2") lib.viewBooks() lib.removeBookItem("985jg") lib.viewBooks() lib.removeBook("The Fault In Our Stars") lib.viewBooks() member1 = Member("Niel", "Mumbai", 23, "ABCD4321", "STUD4321") member2 = Member("Nitin", "Mumbai", 23, "DCBA4321", "STUD8765") print(member2) member1.viewBooks() member1.searchByTitle("Kafka On The Shore")
import sys from Book import Book from Catalog import Catalog from User import Librarian from User import Member m1 = Member("Vish", "Bangalore", 23, 'asljlkj22', 'std1233') lib = Librarian("Awantik", "Bangalore", 34, 'asljlkj22', 'zeke101') lib.addBook('Shoe Dog', 'Phil Knight', "Biography", '2015') lib.addBookItem("Shoe Dog", "123pk", "H1B1") lib.addBookItem("Shoe Dog", "124pk", "H1B2") lib.addBook('Kafka On The Shore', 'Haruki Murakami', "Fiction", '2002') lib.addBookItem("Kafka On The Shore", "854hm", "C1B1") lib.addBookItem("Kafka On The Shore", "685hm", "C1B2") lib.addBook('The Fault In Our Stars', 'John Green', "Romance", '2012') lib.addBookItem("The Fault In Our Stars", "957jg", "R1B1") lib.addBookItem("The Fault In Our Stars", "985jg", "R1B2") b = lib.addBook('Moonwalking with Einstien', 'J Foer', 'Adventure', '2017') lib.addBookItem(b, '463hg', 'K1B2') while (True): print("welocome to the {} library.please Enter your choice".format( lib.name)) print("1", "display_books") print("2", "Issue_book") print("3", "Return book") print("4", "Search book By book_Name") print("5", "Search book By Author_Name") print("\n")
librarian = Librarian("Awantik", "Bangalore", 34, 'asljlkj22', 'zeke101') print(librarian) print("---------------------------------------------------") print("From library class persepective") print("---------------------------------------------------") # l = catalog.searchByAuthor('Jack daniel') # print(l) # print(catalog.__dict__) two_states = librarian.addBook(catalog, "2 states", "Chetan Bhagat", '2010', 340) librarian.addBookItem(catalog, two_states, '554hg', 'S1B2', "#2287") librarian.addBookItem(catalog, two_states, '555hg', 'S1B4', "#2284") print(librarian.__dict__) catalog.displayDifferentBooks() catalog.displayAllBookItems() shoe_dog = librarian.addBook(catalog, 'Shoe Dog', 'Phil Knight', '2015', 312) librarian.addBookItem(catalog, shoe_dog, '123hg', 'H1B2', "#2222") librarian.addBookItem(catalog, shoe_dog, '124hg', 'H1B4', "#6858") librarian.addBookItem(catalog, shoe_dog, '125hg', 'H1B5', "#6833") moon_walking = librarian.addBook(catalog, 'Moonwalking with Einstien', 'J Foer', '2017', 318) librarian.addBookItem(catalog, moon_walking, '463hg', 'K1B2', "#2343")
# -*- coding: utf-8 -*- from User import Member from User import Librarian lib = Librarian("Akhila Madhu", "Kerala", 22, "ED65845", "33541567") print(lib) lib.addBook('Shoe Dog', 'Phil Knight', "2015", 312) lib.addBookItem("Shoe Dog", "123pk", "H1B1") lib.addBook('Iron Man', 'Tony Stark', "2001", 800) lib.addBookItem("Iron Man", "123im", "I1B1") lib.addBook('Moonwalking with Einstien', 'J Foer', "2017", 318) lib.addBookItem("Moonwalking with Einstien", "325ad", "A1B1") lib.addBookItem("Moonwalking with Einstien", "326ad", "A1B2") lib.addBook('Harry Potter', 'J K Rowling', "1997", "312") lib.addBookItem("Harry Potter", "854hm", "C1B1") lib.displayAllBooks() lib.removeBookItemFromCatalog("325ad") lib.displayAllBooks() lib.removeBook("Moonwalking with Einstien") lib.displayAllBooks() member1 = Member("Ron", "Pune", 21, "LID547895", "STU343231") member2 = Member("Rhea", "Kerala", 20, "LID43218", "STU656461") member2.searchByName("Shoe Dog") member1.searchByAuthor("Steve") member1.searchByAuthor("Tony Stark")
# -*- coding: utf-8 -*- from User import Member, Librarian from Catalog import Catalog #creating useres user1 = Member("prasanna","bangalore",22,"zxcc8765","std123") user2 = Member("prashanth","bangalore",23,"zxcc5765","std143") #creating a librarian lib1 = Librarian("admin","mysore",34,"avcgh4352","emp123") #adding book and book items book = lib1.addBook("harry potter","william",2001,500) lib1.addBookItem(book,"123zxc43","h101") lib1.addBookItem(book,"123zxc44","h102") lib1.addBookItem(book,"123zxc45","h103") lib1.addBookItem(book,"123zxc46","h104") book = lib1.addBook("ironman","jhon",2005,300) lib1.addBookItem(book,"125zgc10","g101") lib1.addBookItem(book,"125zgc11","g102") lib1.addBookItem(book,"125zgc12","g103") lib1.addBookItem(book,"125zgc13","g104") book = lib1.addBook("attitude","xyz",2016,350) lib1.addBookItem(book,"765zgc10","h101") lib1.addBookItem(book,"765zgc12","s102") lib1.displayBooks()#displaying the inventory print("\n\n")