Lab: Load the shelf's files and check Tom's notebook
Module 8 · Lab · About 60 minutes · Needs: lessons 1 to 4 of this module, and the Module 7 lab (the booknook folder in your Drive)What you are building
Amira's request for this module is "Load the real files and fix Tom's notes." The four lessons built every piece: loaders for the CSV and JSON files (Lesson 3), try and except to keep going past a bad line (Lesson 1), files opened with with and encoding="utf-8" (Lesson 2), and a hunt that named all five faults in Tom's notebook (Lesson 4).
This lab joins them into one new module, booknook/storage.py, with the five names the course fixed for it: load_books, load_members, load_loans, save_loans and parse_notebook. parse_notebook reads Tom's twelve lines and gives back two lists: the clean loans, and a problem for every faulty line, with its line number. The clean loans are saved to a new file, so the September loans are no longer lost.
Open a new Colab notebook, call it module-08-lab.ipynb, and run each cell in order.