The Librarian Strikes Back: Renaming and Deleting with Style

Day 53 of 100 Days Coding Challenge: Python

We’re rounding the final bend on this book tracker project, and like any good road trip, it’s time to clean out the car before showing it off. Yesterday, I had an itch to tidy up the main menu—it had the organizational charm of a sock drawer after laundry day. It wouldn’t matter much if I were the only one using this program, but I plan to upload it to GitHub. And if you’re going to invite guests into your house, you should at least sweep the floor.

But before I rolled up my sleeves to alphabetize those menu options, I realized one last function was missing: editing or deleting a book from the log. Imagine proudly logging “The Wind in the Pillars” instead of “The Wind in the Willows,” and having no way to fix it. I knew I had to patch that hole. Mistakes happen—we’re human, and sometimes our fingers think faster than our brains.

This new function feels like the final polish on a well-loved tool, the last screw tightened before the machine hums just right.

Today’s Motivation / Challenge

Let’s face it: no book tracking tool is complete if you can’t fix a typo or remove that self-help book you never actually finished (and don’t want to admit you bought). Editing and deleting books makes your log feel more like a digital journal and less like a permanent tattoo. Today’s challenge was about giving myself—and any future users—permission to change their minds.

Purpose of the Code (Object)

This feature adds a small but mighty update to the book tracker: the ability to edit or delete entries in your reading log. It helps you clean up titles, fix authors, update genres, or just delete a book altogether if you never finished it (no judgment). It’s all about control—because even logs deserve second chances.

Functions & Features

  • View a list of all books in your log with entry numbers
  • Edit any detail of a selected book (or leave it unchanged)
  • Delete a book entirely if it was added by mistake
  • Automatically save updates to your CSV log file

Requirements / Setup

pip install pandas

You’ll also need:

  • Python 3.8 or higher
  • A CSV file named book_log.csv in the same folder (or let the script create one)

Minimal Code Sample

df = pd.read_csv(FILE_NAME)

for idx, row in df.iterrows():

    print(f”{idx+1}. {row[‘Title’]} by {row[‘Author’]}”)

choice = int(input(“Choose a book to edit or delete: “)) – 1

This snippet prints a numbered list of books and lets the user choose one to modify.

Book Tracker

Notes / Lessons Learned

Adding new features is getting easier—finally! The hardest part this time wasn’t writing the logic; it was making the user interface feel smooth and forgiving. I had to read through my own book log like a detective, catch typos, and trace the moment a “Memoir” turned into “Memor.” It turns out, the edit function is not just about fixing mistakes. It’s about telling your story the way you meant to tell it.

At one point, I found a mismatch between my Notion log and the CSV file this script uses. That’s when I decided: I’ll start fresh—clean log, clean menu, clean conscience.

Optional Ideas for Expansion

  • Add a search function so you can find books by keyword before editing.
  • Include a confirmation screen to preview changes before saving.
  • Show book stats (like total pages read) after edits are made.

Leave a Reply

Your email address will not be published. Required fields are marked *