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.
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.”

