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.

Breaking News, Built by Me

Day 37 of 100 Days Coding Challenge: Python

I have so many morning routines now that I need a morning routine just to organize them. Somewhere between meditating, hydrating, and pretending I’ll stretch for ten minutes, I give myself about five sacred minutes to scroll headlines on Google Pixie—my beloved phone, not a whimsical AI assistant (though honestly, close). It’s funny to think how much easier it is now than in the ‘90s, when “catching up on the news” meant flipping through an actual newspaper or—if you were tech-savvy—tapping into Yahoo News. I used to wonder whether those top headlines were handpicked by real people or magically summoned by a robot in a cubicle. Well, today I decided to find out what it feels like to be that robot. Except mine runs on Python and coffee.

Today’s Motivation / Challenge

There’s something delightful about making your own mini news reader. It’s like building a personal butler who only tells you the important stuff—no ads, no clickbait, no Kardashian updates (unless you really want them). Today’s challenge wasn’t just about coding; it was about reclaiming five minutes of my day from mindless scrolling and putting a bit of personality into my news.

Purpose of the Code (Object)

This little script fetches the top headlines from the internet and displays them in your terminal—clean, fast, and focused. You don’t need to open a browser or wade through a swamp of autoplay videos. It’s just a straight shot to what’s happening in the world, courtesy of your own code.

AI Prompt:

Write a Python script that uses NewsAPI to display the top 10 headlines in the terminal. Use environment variables for the API key. Keep the script simple and readable.

Functions & Features

  • Connects to NewsAPI and fetches top news headlines
  • Displays each headline and a brief description (if available)
  • Includes clickable links for more information
  • Clean, readable terminal output

Requirements / Setup

  • Python 3.x

Install these packages:

pip install requests python-dotenv

Minimal Code Sample

from dotenv import load_dotenv

import os, requests

load_dotenv()

api_key = os.getenv(“NEWS_API_KEY”)

response = requests.get(“https://newsapi.org/v2/top-headlines”, params={

    “country”: “us”, “apiKey”: api_key, “pageSize”: 10

})

for article in response.json()[“articles”]:

    print(article[“title”])

This snippet grabs the top 10 headlines and prints their titles. Simple and effective.

News Headline Reader

Notes / Lessons Learned

The coding went suspiciously smoothly today—almost unsettling. I finally did what every tutorial whispers about but no one actually does: I created a dedicated virtual environment. Then I installed the required libraries like a responsible adult. Getting an API key from newsapi.org was straightforward, and I even tucked it safely into a .env file (no more hardcoded sins). .gitignore? Created. requirements.txt? Generated with pride. After a few past failures, I’m beginning to feel like I almost know what I’m doing. It’s like learning to ride a bike, except the bike is made of code and occasionally throws a syntax error.

Optional Ideas for Expansion

  • Add voice support using pyttsx3 to read headlines aloud (hello, audio butler)
  • Let the user filter headlines by category (e.g., sports, tech, science)
  • Include headlines from multiple countries using user input