Question
Irma Pince's Library Management System Irma Pince's Library Management System The Hogwarts librarian has many duties, including: Paperwork: Establishing library rules, regulations, policies and procedures.
Irma Pince's Library Management System
Irma Pince's Library Management System
The Hogwarts librarian has many duties, including:
Paperwork:
- Establishing library rules, regulations, policies and procedures.
- Preparing the library due date sheets and maintaining overdue records.
- Prepare and manage the library budgets, circulation files, statistics and inventories.
- Classify, and catalogue library books in order to properly making them ready for checkout.
Practical work:
- Monitoring the Library, as well as keeping it organized, clean and neat.
- Assisting students and staff members in finding the desired reading material.
- Implementing and enforcing library rules, regulations, policies and procedures.
- Placing spells on the books aimed at protecting them from mistreatment or theft.
- Checking the authenticity of the written permissions slips for the Restricted Section.
- Making sure all students have left the library by 8:00 pm, at which time the library closes.
- Overseeing the Study Hall and helping students with academic research and/or homework.
- Undertaking any other reasonable duty at the request of the Headmaster/Headmistress of Hogwarts.
Technical Details
- Everything in Stage I goes into main.py
- Take a command line argument which is the filename, which is the command script, in your main statement. Do NOT take input! Read the file with the given filename.
- Create a function called hogwarts_library() which takes one input argument which is a string representing all the contents of command script.
- Process the string line-by-line (Hint: split by newline character)
- Create a variable (in modular scope) named "book_collection", as a dictionary with the key being a string, book_title, and the value a Book nametuple instance.
- Create a function command_nb() which takes in one single line of command (a string) starting with "NB" and process accordingly
- Create a function command_li() which takes in one single line of command (a string) starting with "LI" and process accordingly
- Create a function command_db() which takes in one single line of command (a string) starting with "DB" and process accordingly
- Create a function command_fb() which takes in one single line of command (a string) starting with "FB" and process accordingly
- Create a function command_as() which takes in one single line of command (a string) starting with "AS" and process accordingly
- Create a function command_lm() which takes in one single line of command (a string) starting with "LM" and process accordingly
- Create a function command_pl() which takes in one single line of command (a string) starting with "PL" and process accordingly
- In hogwarts_library(), call one of the command_* functions whenever a newline in command script is stepped onto
- Add functions using the format/pattern above for other commands as needed in each stage
- Don't be afraid to think outside the box.
Stage I
For this stage, your program will keep track of the rooms that are available. This stage implements four commands, as described below. On each command line, the first two non-whitespace characters are the command; command letters may be upper or lower case.
- NB (for "Add a New Book") followed by a comma separated list of fields: title=Title,author=Author,year_published=####,subject=Subject, section=Restricted Add a new book with the specified information. To keep the project simple, we only allow one copy of a book to present in the library.
- LI (for "List Inventory"). Print a list of all books owned/maintained by the library sorted by title.
- DB (for "Delete Book") followed by a title=Title. Print the message, "Book Not Found. Cannot be deleted." if the specified book isn't present in the library. NOTE: You will update this function again in Stages II & III.
- FB (for "Find Books") followed by 0 or more of the following search criteria: title=Title,author=Author,year_published=####,subject=Subject,section=Section. Print a list of books, sorted by title, that are owned/maintained by the library that meet the provided criteria. If 0 criteria is provided, then print all books. If no books are found matching the criteria provided, print the message, "No Books Found."
- AS (for "Add Student") followed by the following fields: student_name=Student Name, house_name=House. Add the student to library members. If the student is already present, print "Student Name is already present."
- LM (for "List Members") prints members according to each house, sorted by house and member name. If no members of a house are registered, print "No Registered Members".
- PL (for "Print Line"), followed by any text. Simply print (or "echo") a line, copying the input (not counting the PL and leading whitespace) to the output. You'll find it useful in testing, and it's also a simple way to make the program's reports clearer or fancier.
- ** Comment, followed by any text. Like comments in a program, comment lines don't have any effect on the program's behavior; they just serve as annotations in the command file.
The input file may contain any number of these commands in any order. See the sample output below for the format of the printed books list.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started