How I Made My Python Book Tracker Fully Customizable

Day 55 of 100 Days Coding Challenge: Python

Once upon a time—okay, a few days ago—I had my genre-color pairings carved in digital stone. Tucked inside a function like a squirrel’s hoard of acorns, the genres and their matching hues were hard-coded, like:

“Historical Fiction”: “sienna”,

“Fiction”: “gray”,

“Memoir”: “lightcoral”,

You get the idea.

Back then, it felt efficient. But let’s be honest: it was as user-friendly as a brick in a gift box. So I set out to give my humble book tracker a glow-up. I added functionality to let users add their own genres, pick colors from a GUI color chooser, save them in a JSON file, and even reorder or delete genres if needed. No more pre-determined palettes—now users can start with a clean slate.

With all those new powers in place, it became clear: the old load_genre_colors() hardcoded fallback was now the fossil in the room. So I yanked it out and simplified the codebase. And just to test it, I cleared out most of my book log entries too—leaving only a lean trio: Fantasy, Science Fiction, and Romance. The result? A slicker, cleaner, beginner-friendly tool. And no more assumptions about people loving “lightcoral.”

Today’s Motivation / Challenge

Today’s challenge was about trust. Not between people—but between me and my code. I wanted to trust my users enough to let them decide what genres they care about and what colors they want. The control panel is theirs now. My job? Just to make sure the wires behind the scenes don’t catch fire.

This was also a step toward user-friendliness. The kind that makes someone say, “Hey, I could actually use this!” rather than “What on earth is ‘slateblue’?”

Purpose of the Code (Object)

This program is a customizable book tracker. It lets users log what they read, track their reading progress over time, and visualize it through colorful charts. It also gives them complete control over how genres are defined and displayed—no default lists, no assumptions.

AI Prompt:

“Can I remove the hardcoded genre-color mapping and just let the user build their own?”

Yes. And I did.

Functions & Features

  • Add, edit, or delete book entries
  • Define custom genres and pick colors for each
  • Save genre-color preferences in a JSON file
  • View genre breakdowns via pie or bar charts
  • Reorder genre list and edit mappings interactively

Requirements / Setup

Install the essentials:

pip install pandas matplotlib

If using the color picker:

pip install tk

Tested with Python 3.10+

Minimal Code Sample

genre_color_dict = {

    ‘Fantasy’: ‘purple’,

    ‘Science Fiction’: ‘blue’,

    ‘Romance’: ‘red’

}

This is where your genre-color story begins—users can expand it from here.

Book Tracker App

Notes / Lessons Learned

Actually, for the first time in this series, I wrestled with my own AI prompt. You see, the chat history had gotten so long (we’ve been working on this file for over two weeks) that when I asked to “remove the hardcoded section,” it started offering way too much interpretation—like a method actor who wouldn’t stop improvising.

Eventually, I had to open a fresh chat in the same project folder and restate everything clearly. That’s when it hit me: AI is powerful, but not psychic. It only knows what you tell it. If you’re not precise with your wording, it’ll do what it thinks you mean, not what you actually mean.

Just like coding, AI prompting is a language of its own. Respect it. Be clear. And maybe don’t expect it to read your mind… yet.

Optional Ideas for Expansion

  • Add a “preview” button to visualize the genre-color palette before saving it
  • Let users export their reading stats as an image or PDF report
  • Build a tag system so one book can belong to multiple genres (for the indecisive types)

Let’s be honest, even Tolkien would’ve struggled choosing between “Fantasy” and “Adventure.”

Taming the Menu Beast: When Order Matters More Than Code

Day 54 of 100 Days Coding Challenge: Python

I’ve been dancing with this project for over two weeks now. And you know what? When your project involves books—the thing you’re borderline obsessed with—you start fussing over the little things. Like menus. Yes, menus.

Today was the day I finally tackled something that had been silently bothering me: the out-of-whack order of the main menu. I had “Exit” sitting at #7 like it owned the place, while other features awkwardly piled up from 8 to 12. Not exactly elegant. So I did what any self-respecting, slightly neurotic book tracker would do—I cleaned house.

I reorganized the main menu to follow a more logical and satisfying sequence. Something clean, orderly, and sometimes won’t drive future-me (or any poor GitHub visitor) up the wall.

Here’s the new lineup, alphabet soup no more:

  1. Add a book
  2. Edit or delete a book
  3. Show all books
  4. Import from CSV
  5. Show overall reading graph
  6. Show genre summary chart (Pie or Bar)
  7. Show filtered chart by year and quarter
  8. Show average pages per genre per quarter
  9. Add a new genre and color
  10. Rename or delete a genre
  11. Reorder genre list manually
  12. Exit

Take that, chaos.

Today’s Motivation / Challenge

The real motivation? Sanity—and a sprinkle of future-proofing. I want to post this project on GitHub when it’s done, and I figured any stranger poking around deserves a user-friendly menu. Think of it like alphabetizing your spice rack: not necessary, but undeniably satisfying.

Also, adding new functions is becoming easier. Which means cleaning up after myself is now the least I can do.

Purpose of the Code (Object)

This script tracks the books you’ve read and turns them into beautiful visual summaries. From adding titles to generating colorful graphs, it’s designed to help readers stay organized, reflect on their reading habits, and play with genre data like it’s LEGO.

Today’s focus? Making the main menu feel like a polished app, not a last-minute potluck.

AI Prompt:

“Reorder the menu options and update the corresponding elif statements so the user sees a more intuitive and logically grouped main menu.”

Functions & Features

  • Add, edit, or delete book entries
  • Import a list of books from a CSV
  • Display all books in a clean format
  • Visualize reading progress with graphs
  • Analyze reading trends by genre and quarter
  • Manage genres with custom colors and order

Requirements / Setup

pip install matplotlib

pip install pandas

tkinter (comes pre-installed with Python)

Tested with Python 3.10+

Minimal Code Sample

print(“12. Exit”)

elif choice == “12”:

    print(“Goodbye!”)

    break

Just update the number and make sure the function still points to the right feature. Think of it like updating the index in your table of contents—crucial if you don’t want your reader flipping to the wrong page.

Book Tracker

Notes / Lessons Learned

Basically, what you need to do is reassign the menu numbers in the order you want. Then, carefully adjust each elif block to reflect the new structure.

I had:

elif choice == “7”:

    print(“Goodbye!”)

    break

Now I want:

elif choice == “12”:

    print(“Goodbye!”)

    break

The actual task wasn’t hard. The challenge was not falling into a logic trap—accidentally assigning two features to the same number or skipping one entirely. I highly recommend using AI or a numbered to-do list when reordering more than a few options. Saves brain cells.

It’s funny how a simple reorder can make the whole project feel more finished, more elegant—even if no code logic changes at all.

Optional Ideas for Expansion

  • Let users “star” favorite genres for quick filtering
  • Add keyboard shortcuts for power users
  • Enable saving custom menu layouts as presets

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.

Graphing My Way Through the Library

Day 52 of 100 Days Coding Challenge: Python

You know you’ve reached a new level of coding attachment when you start treating your genre list like a prized bonsai tree—snipping here, trimming there, fussing over every little branch of logic. After revamping the program so it could accept new genres and pretty colors via a palette (very fancy, I know), I realized there was no graceful way to unmake a genre. What if I added “Historicl Fiction” by mistake? What if I picked a color so hideous that even my pie chart looked like it wanted to gag?
Today was all about giving myself the power to fix those flubs. Rename it, delete it, clean up my genre garden—snip snip! Because frankly, if I don’t like the color, the genre might just have to go.

Today’s Motivation / Challenge

Every great coder hits that moment where they scream at the screen, “Why can I add but not delete?!” It’s like buying furniture without knowing how to return it. I wanted my program to feel flexible, like a well-organized closet—not a hoarder’s storage unit of genre typos and duplicate categories. And let’s be honest, sometimes “Fantasy” and “Science Fiction” are just playing dress-up in each other’s clothes. Merge, rename, delete, repeat.

Purpose of the Code (Object)

This update lets users do a little genre housekeeping. You can now clean up your list by renaming genres (in case of typos or re-categorizing) or deleting them completely. It helps keep your visualizations tidy and your data organized—without diving into the JSON file manually. Think of it like giving your genre system a tiny admin panel without the drama.

AI Prompt:


Add a feature to let users rename or delete genres from the saved genre-color dictionary and persist it using JSON.

Functions & Features

Add a new genre and assign it a color using a color picker
Save all genres and colors to a JSON file automatically
Rename existing genres in case of typos or reclassification
Delete genres that are no longer wanted
Keep your pie charts and reports squeaky clean

Requirements / Setup

Install required library: pip install matplotlib pandas
Python 3.9 or later recommended for date handling and plotting.
No external JSON library needed—just the built-in json and os modules
tkinter (comes with Python standard library)

Minimal Code Sample

def rename_or_delete_genre(genre_color_dict):
print(“\nCurrent Genres:”)
for genre in genre_color_dict:
print(f”- {genre}”)

choice = input("\nRename or Delete? (r/d): ").strip().lower()
if choice == 'r':
    old = input("Old genre name: ")
    new = input("New genre name: ")
    if old in genre_color_dict:
        genre_color_dict[new] = genre_color_dict.pop(old)
        print(f"Renamed '{old}' to '{new}'.")
    else:
        print("Genre not found.")
elif choice == 'd':
    target = input("Genre to delete: ")
    if target in genre_color_dict:
        del genre_color_dict[target]
        print(f"Deleted '{target}'.")
    else:
        print("Genre not found.")
save_genre_colors(genre_color_dict)

This snippet shows how to let users clean up the genre-color dictionary and save the changes.

Book Tracker

Notes / Lessons Learned

This might sound like a small tweak, but it was a surgical upgrade. I tested, tweaked, and made backup copies like I was preparing to launch a space probe, not a genre menu. And wow—what a difference it made. Now if I want to merge “Thriller” into “Mystery,” I don’t need to panic about breaking anything.
It also got me thinking about naming in general. Genres are a bit like moods—they shift. So it helps to keep things tidy and editable. Pro tip? Rename before deleting, just in case you regret it five seconds later.
Also, I’m now officially annoyed that my function menu jumps from 7 to 11. Time to refactor. Naming may be hard, but numbering is… even harder?

Optional Ideas for Expansion

  • Add a feature to merge two genres into one, including updating past entries
  • Include a log file that records changes to genres for version control
  • Let users reorder the genre list manually so the menu stays tidy and satisfying

A Little Genre Surgery: Rename, Remove, Repeat

Day 51 of 100 Days Coding Challenge: Python

You know you’ve reached a new level of coding attachment when you start treating your genre list like a prized bonsai tree—snipping here, trimming there, fussing over every little branch of logic. After revamping the program so it could accept new genres and pretty colors via a palette (very fancy, I know), I realized there was no graceful way to unmake a genre. What if I added “Historicl Fiction” by mistake? What if I picked a color so hideous that even my pie chart looked like it wanted to gag?

Today was all about giving myself the power to fix those flubs. Rename it, delete it, clean up my genre garden—snip snip! Because frankly, if I don’t like the color, the genre might just have to go.

Today’s Motivation / Challenge

Every great coder hits that moment where they scream at the screen, “Why can I add but not delete?!” It’s like buying furniture without knowing how to return it. I wanted my program to feel flexible, like a well-organized closet—not a hoarder’s storage unit of genre typos and duplicate categories. And let’s be honest, sometimes “Fantasy” and “Science Fiction” are just playing dress-up in each other’s clothes. Merge, rename, delete, repeat.

Purpose of the Code (Object)

This update lets users do a little genre housekeeping. You can now clean up your list by renaming genres (in case of typos or re-categorizing) or deleting them completely. It helps keep your visualizations tidy and your data organized—without diving into the JSON file manually. Think of it like giving your genre system a tiny admin panel without the drama.

AI Prompt:

“Add a feature to let users rename or delete genres from the saved genre-color dictionary and persist it using JSON.”

Functions & Features

  • Add a new genre and assign it a color using a color picker
  • Save all genres and colors to a JSON file automatically
  • Rename existing genres in case of typos or reclassification
  • Delete genres that are no longer wanted
  • Keep your pie charts and reports squeaky clean

Requirements / Setup

pip install matplotlib pandas

(Also includes built-in modules like json and os, so no sweat there.)

Minimal Code Sample

def rename_or_delete_genre(genre_color_dict):

    print(“\nCurrent Genres:”)

    for genre in genre_color_dict:

        print(f”- {genre}”)

    choice = input(“\nRename or Delete? (r/d): “).strip().lower()

    if choice == ‘r’:

        old = input(“Old genre name: “)

        new = input(“New genre name: “)

        if old in genre_color_dict:

            genre_color_dict[new] = genre_color_dict.pop(old)

            print(f”Renamed ‘{old}’ to ‘{new}’.”)

        else:

            print(“Genre not found.”)

    elif choice == ‘d’:

        target = input(“Genre to delete: “)

        if target in genre_color_dict:

            del genre_color_dict[target]

            print(f”Deleted ‘{target}’.”)

        else:

            print(“Genre not found.”)

    save_genre_colors(genre_color_dict)

This snippet shows how to let users clean up the genre-color dictionary and save the changes.

Book Tracker

Notes / Lessons Learned

This might sound like a small tweak, but it was a surgical upgrade. I tested, tweaked, and made backup copies like I was preparing to launch a space probe, not a genre menu. And wow—what a difference it made. Now if I want to merge “Thriller” into “Mystery,” I don’t need to panic about breaking anything.

It also got me thinking about naming in general. Genres are a bit like moods—they shift. So it helps to keep things tidy and editable. Pro tip? Rename before deleting, just in case you regret it five seconds later.

Also, I’m now officially annoyed that my function menu jumps from 7 to 11. Time to refactor. Naming may be hard, but numbering is… even harder?

Optional Ideas for Expansion

  • Add a feature to merge two genres into one, including updating past entries
  • Include a log file that records changes to genres for version control
  • Let users reorder the genre list manually so the menu stays tidy and satisfying

Fifty Shades of Hue: Letting the User Pick the Palette

Day 50 of 100 Days Coding Challenge: Python

Some people know the names of colors the way sommeliers know wines—by region, undertone, and emotional baggage. I am not one of those people. The other day, I misspelled a color name while trying to assign it to a new genre. I expected a big angry error message. Instead? Python shrugged and picked something. It was a shade, I suppose, but not the one I had in mind. That’s when I realized: if I’m going to survive this genre-color dance, I need more than luck. I need a color picker.

So today’s upgrade is all about seeing what you’re getting. No more guessing if “slateblue” is dusty or deep, no more typing out names like “lightgoldenrodyellow” with trembling fingers. Now I just click, pick, and go. Call it coding for the colorblindly optimistic.

Today’s Motivation / Challenge

Because naming colors from memory is a trap. Unless you moonlight as a paint chip designer at Benjamin Moore, chances are you don’t know your cornflower from your cadet blue. Adding a visual color picker turns the guessing game into a satisfying click-and-smile experience. Think of it as your genre’s fashion stylist—choosing just the right outfit without you typing the wrong thing.

Purpose of the Code (Object)

This project adds a GUI color picker to the genre customization tool. Now, when you want to assign a new color to a genre, a little window pops up and lets you see your options—no spelling errors, no surprises. Once you choose your color, the code saves it so your pie charts remain stylish and sensible across runs.

AI Prompt:

Create a visual color picker for assigning genre colors in a book tracking program using tkinter. Make sure the selection is saved and reused.

Functions & Features

  • Add new genres with customized colors
  • Pick colors visually using a color palette window
  • Automatically save selected colors to a persistent JSON file
  • Load colors each time the program starts—no hardcoding needed
  • Keeps your genre pie charts looking consistent and fabulous

Requirements / Setup

 Built-in modules only—no pip installs needed!
Just make sure you’re using:

  • Python 3.x
  • tkinter (comes with Python standard library)

Minimal Code Sample

def choose_color_gui():

    import tkinter as tk

    from tkinter import colorchooser

    root = tk.Tk()

    root.withdraw()

    return colorchooser.askcolor(title=”Choose a Color”)[1]

This little window lets you visually pick a HEX color without typing anything.

Book Tracker

Notes / Lessons Learned

Adding a color picker was smoother than expected—until I realized the pop-up window was hiding behind my active screen. Cue two minutes of wondering if the code was broken, followed by an “aha!” moment on screen two. Also, as always, I backed up my program first. Rule #1 of coding anything visual: back up, test, and be ready for the ghost windows that pop up in the digital shadows. But once I found it, the tool worked beautifully. For someone like me—who thinks in color families, not exact swatches—this is a game changer.

Optional Ideas for Expansion

  • Add a “preview pie chart” before saving the color to test how it looks
  • Suggest complementary or contrasting colors based on your selection
  • Group similar genres with similar shades for aesthetic cohesion

The Case of the Missing Genre: Solved by JSON

Day 49 of 100 Days Coding Challenge: Python

One day, you’re happily adding a shiny new genre—Mystery—and the next day it’s gone, vanished like a plot twist in an Agatha Christie novel. No “goodbye,” no note, not even a hint of suspense music. I had proudly added a function yesterday to introduce new genres and assign them pretty colors. But today? That color-coded Mystery entry was MIA.

It turns out I was adding it, but… nowhere permanent. The program was as forgetful as I am without caffeine. So, I rolled up my digital sleeves and decided it was time to get serious. Enter: the humble JSON file. My mission? To build a system where genres and their colors stick around—even after the script shuts down. This also meant rewriting a lot of the functions that were still clinging to the old hardcoded dictionary, like it was a safety blanket. It was a minor genre revolution.

Today’s Motivation / Challenge

Why bother with persistent data? Well, imagine creating something you’re proud of—then watching it vanish the next time you open the program. Frustrating, right? This project reminded me of learning to save Word documents the first time you write them. This was about teaching my Python script to remember what I told it… like a well-trained assistant, not a goldfish.

Purpose of the Code (Object)

This update allows the program to permanently remember newly added genres and their colors. Instead of living only in memory (and disappearing the moment you close your terminal), your genres are now safely stored in a JSON file—ready to return every time you open the app. It’s like giving your code a diary… and making sure it actually writes in it.

AI Prompt

Able to save newly added genres and their colors.

Functions & Features

  • Load genre-color pairs from a JSON file at startup
  • Add new genres with custom colors on the fly
  • Automatically save those updates so nothing gets lost
  • Replaces hardcoded dictionaries with dynamic loading

Requirements / Setup

  • Python 3.6+
  • pandas, matplotlib
  • No external JSON library needed—just the built-in json and os modules

Install if needed:

pip install pandas matplotlib

Minimal Code Sample

import json

import os

GENRE_FILE = “genre_colors.json”

def load_genre_colors():

    if os.path.exists(GENRE_FILE):

        with open(GENRE_FILE, ‘r’) as f:

            return json.load(f)

    return {

        “Fiction”: “gray”,

        “Fantasy”: “purple”

    }

def save_genre_colors(genre_color_dict):

    with open(GENRE_FILE, ‘w’) as f:

        json.dump(genre_color_dict, f, indent=4)

# Use these to load and update your color map

genre_color_dict = load_genre_colors()

This snippet loads and saves your genre-color dictionary using a JSON file instead of hardcoded values.

Book Tracker

Notes / Lessons Learned

This was actually a significant overhaul of the existing programming. I was so nervous I triple-checked every line and even cloned my file before making changes—just in case things went full chaos mode. First, I had to import json and os, then create a file path for my new JSON genre diary. Next, I rewired the loading function to pull from this file, and rewrote add_new_genre_color() to actually save the additions (not just pretend).

Then came the big cleanup: my program was still using GENRE_COLORS all over the place like it was 2022. Every instance had to be swapped with genre_color_dict to work with my new system. That part? Not glamorous. But when I ran the script and everything held together—and Mystery stayed put—it felt like winning a game of digital Clue.

Optional Ideas for Expansion

  • Add a user input menu to pick a color visually from a palette (instead of typing ‘slateblue’)
  • Add a “reset to default” feature if your JSON file ever gets out of hand
  • Include tooltips in the visualization showing genre + average page counts

Adding a Splash of Genre Flair

Day 48 of 100 Days Coding Challenge: Python

After days of tinkering with this book tracker like a mad librarian with a barcode scanner, I realized something important: I don’t want to be the poor soul manually updating the genre-color dictionary every time I read something new. Let’s face it—“User-friendly” doesn’t mean much when the only user is me, and I still find myself muttering, “Why isn’t this thing purple?” every time I forget to update the genre list.

So today’s quest? Build a feature that lets me add new genres and assign them pretty little colors on the fly—without breaking the whole program or sending myself into a debugging spiral. It’s not just about aesthetics. It’s about freedom. Genre freedom. Color-coded, quarter-sorted, reader-powered freedom.

Today’s Motivation / Challenge

Sometimes, your biggest obstacle is your past self—the one who hardcoded things thinking they’d never change. Past Me didn’t expect Present Me to branch out from Fantasy and Sci-Fi. But here we are, reading historical dramas and the occasional poem. Rather than letting my program judge me for my evolving tastes, I figured it was time to teach it some manners. Today’s challenge was about flexibility: giving my tracker the power to grow as my reading list does.

Purpose of the Code (Object)

This update makes the book tracker more interactive and adaptable. Instead of manually editing the genre-color dictionary every time I pick up a new type of book, I can now add a new genre and assign it a color from within the program itself. It’s one small line of code for me, one giant leap for my sanity.

AI Prompt:

“Add a function that allows the user to update the genre-color dictionary during runtime without editing the code directly.”

Functions & Features

  • Add and assign a new genre with a custom color
  • Auto-updated pie and bar charts include the new genre
  • Prevents duplicate genres by checking existing entries
  • Keeps your genre list as fresh as your reading habits

Requirements / Setup

You’ll need:

pip install matplotlib pandas

Python 3.8+ is recommended, but it should work on most modern versions.

Minimal Code Sample

def add_new_genre_color(genre_color_dict, new_genre, new_color):

    if new_genre in genre_color_dict:

        print(f”{new_genre} already exists with color {genre_color_dict[new_genre]}.”)

    else:

        genre_color_dict[new_genre] = new_color

        print(f”Added new genre: {new_genre} with color {new_color}.”)

This simple function updates the dictionary in real time, without opening the script file.

Book Tracker

Notes / Lessons Learned

One of the biggest challenges I’m facing now is the trail of code left behind by my earlier, less organized self. Back then, I hardcoded colors like a kid with a new box of crayons and zero aesthetic restraint. The result? A genre list that doesn’t always match my pie chart, or my mood.

Today, I tested the new feature by adding “Mystery” as a genre. I even fabricated a “Mystery Book” just to make sure it worked. Spoiler: it did. And yes, it showed up beautifully in the pie chart too. Eventually, I might scrap the rigid GENRE_COLORS dictionary altogether and switch to a fully dynamic model—one that builds as I read. One genre at a time.

Optional Ideas for Expansion

  • Save updated genres and colors to a JSON file so they persist after the script closes
  • Add a feature to suggest random colors if the user can’t pick one
  • Let users rename or delete genres via a menu option

Quarterly Exhaustion: Which Genres Drain Your Brain?

Day 47 of 100 Days Coding Challenge: Python

I read for all kinds of reasons—personal growth, research, curiosity, or just to escape reality for a few hundred pages. And because of that, my bookshelf looks like it belongs to someone with multiple personalities. I’ve always known that I gravitate toward science fiction and fantasy (Stormlight Archive, anyone?), but lately I’ve had a sneaking suspicion: fantasy books might secretly be way longer than anything else.

So today, I decided to test that theory by adding a feature to calculate the average number of pages per genre per quarter. If fantasy is the literary equivalent of leg day, I want to know. And if I’m dragging by the end of Q3, it’s probably Brandon Sanderson’s fault.

Today’s Motivation / Challenge

You know that feeling when you finish a 900-page fantasy tome and think, “Why am I so tired?” Well, data can tell you why. Today’s challenge was to turn that vague feeling into a measurable trend. Think of it like a quarterly report—but instead of sales revenue, we’re analyzing book-induced fatigue.

Purpose of the Code (Object)

This code analyzes your reading log and breaks down the average number of pages you’ve read per genre, grouped by quarter. It helps you discover seasonal trends in your reading habits—like whether you go hard on historical fiction in spring or slow-burn through sci-fi during winter.

AI Prompt:

Add the function to calculate the average page count per Genre, grouped by quarter.

Functions & Features

  • Calculates average page count per genre, grouped by quarter
  • Displays the data in both printed table form and as a bar chart
  • Helps you discover which genres are “page-heavy” per season
  • Adds one more analytical layer to your personal book dashboard

Requirements / Setup

pip install pandas matplotlib

Minimal Code Sample

df[‘Quarter’] = df[‘Date Finished’].dt.to_period(‘Q’)

avg_pages = df.groupby([‘Quarter’, ‘Genre’])[‘Pages’].mean().unstack().fillna(0)

avg_pages.round(1).plot(kind=’bar’)

This snippet groups books by quarter and genre, calculates the average pages, and plots a bar chart.

Book Tracker

Notes / Lessons Learned

I’m officially over my fear of virtual environments—no more mysterious typos or wondering why the environment won’t activate. Adding this new function was pretty smooth. One thing I still find slightly annoying is juggling the menu options. Now that “exit” is option 7 and this new analysis is 8, my orderly brain twitches a little. But hey, renumbering is just cosmetic, right?

Honestly, the more I work on this program, the more I feel like it’s becoming mine. I’m not just learning Python anymore—I’m building something I actually want to use. That’s got to be the most rewarding part. Well, that and finally proving that fantasy books are absolute beasts.

Optional Ideas for Expansion

  • Let users filter by author to see who writes the longest tomes
  • Export the genre-per-quarter averages to a CSV file for archiving
  • Add a “reading fatigue index” based on total pages per week

Quarters, Colors, and the Gospel of Granular Reading Data

Day 46 of 100 Days Coding Challenge: Python

I’ve been tinkering with this book tracker for almost five days now, and let me tell you—things are starting to look serious. Not “move-in-together” serious, but close. As the code grows chunkier, I’ve been extra cautious about how I add each new function. Rather than throwing in five features and hoping nothing explodes, I take the accountant’s route: one entry at a time, reconciled and balanced.

Why the sudden urge to filter by quarter? Well, in the world of corporate accounting—where I live and breathe—we worship the fiscal calendar. Quarterly reporting is practically a sacrament. Automotive manufacturers slow down in summer and December, and trust me, so do I (with a good fantasy novel in hand). But that’s just a hunch. I wanted cold, clean, spreadsheet-worthy evidence that I read more Gothic tales as leaves fall and pumpkins rise. Gut feeling isn’t GAAP-approved. So today, we brought seasonal analysis into the Book Tracker universe.

Today’s Motivation / Challenge

Today’s challenge was simple but essential: how do you filter your data like a pro and still keep your chart options open? I wanted to analyze my reading habits by year and season, just like I do with budgets and forecasts. This time, instead of revenue trends, I’m tracking fantasy epics and Gothic drama. Same logic. Less coffee.

Purpose of the Code (Object)

This update adds the ability to view genre summaries filtered by year and, optionally, by quarter. The user can pick a year (and a quarter if they want) and choose between a pie chart or a bar chart to visualize what they’ve been reading. It’s like a financial report, but for books—and it’s way more colorful.

AI Prompt: 

“Add a menu option that lets the user filter the genre summary by year and quarter, and display the data in either a pie or bar chart based on their choice. Keep the code clean and beginner-friendly.”

Functions & Features

  • Lets users filter reading data by year and quarter
  • Visualizes genre distribution as either a pie chart or bar chart
  • Builds on existing color-coded genre system
  • Detects invalid input and guides the user gently (and politely)

Requirements / Setup

pip install pandas matplotlib

Python 3.9 or later recommended for date handling and plotting.

Minimal Code Sample

year = int(input(“Enter year to analyze: “).strip())

df = df[df[‘Date Finished’].dt.year == year]

quarter_input = input(“Enter quarter (1–4) or press Enter to skip: “).strip()

if quarter_input:

    df = df[df[‘Date Finished’].dt.quarter == int(quarter_input)]

This snippet filters your book log by the chosen year and optional quarter.

Book Tracker

Notes / Lessons Learned

The more I add features, the more I see the architecture underneath the code. This little book tracker has evolved into a proper app—with clearly separated layers: imports, genre definitions, graphing logic, and menu options. Honestly, that’s kind of magical. It’s like finally understanding how your espresso machine works after years of just pressing the button.

There’s a quiet thrill in building something you actually want to use. This wasn’t just another tutorial—I created a tool tailored to my reading life. And somewhere between bug-fixing and plotting pie charts, I realized: 46 days in, I’ve gone from curious coder to confident tinkerer. Not bad for someone who thought Python was just a snake when this all started.

Optional Ideas for Expansion

  • Add filters for author or language (in case you read in multiple languages)
  • Include average pages per genre per quarter to see which genres exhaust you
  • Export filtered results as a CSV report for sharing or archiving