CoursePython from Scratch to Intermediate · Module 7: Modules, the Standard Library and Packages · part 50 of 75
Part 50 · Module 7: Modules, the Standard Library and Packages

Lab: The booknook package, on real dates

16 min read·14 Oct 2026
Module 7 · Lab · About 60 minutes · Needs: lessons 1 to 4 of this module, and the Module 6 lab (the five settled functions)

What you are building

BOOKNOOK/ (YOUR DRIVE: MYDRIVE/BOOKNOOK) booknook/ the package __init__.py fees.py dates.py catalogue.py data/ the shelf records books.csv loans.csv members.json tom_notebook.txt requirements.txt pytest==9.1.1 notebook answer: 580p owed
The finished project: the package (blue) that you import, the shelf's data files (grey), the pinned requirements, and the morning answer it gives (green).

Amira's request for this module is "Use real dates." The four lessons built the pieces in Colab's own folder, which empties itself when the session ends. This lab puts them together as one project folder, booknook, kept in your Google Drive, where every lab from now on adds to it.

Inside the folder go the Python package booknook with four modules: fees.py (the rules, late_fee and reminder_text), dates.py (due_date, days_late and is_overdue on real dates), and a new catalogue.py (books per genre, copies on the shelf). Beside the package go the four data files from the course's shared data and requirements.txt. Then a notebook imports the package and answers Amira's morning question from real dates: four loans overdue, 580 pence owed.

Open a new Colab notebook, call it module-07-lab.ipynb, and run each cell in order.

The rest of this part opens with an account

Signing up is free and takes one email. Nothing to pay, and nothing renews.