Day 42 of 100 Days Coding Challenge: Python
Instead of starting a shiny new project file (and the inevitable spiral of new virtual environments), I decided to stick with yesterday’s book tracker and give it a little more love. Reading is one of my enduring passions—and also a data problem waiting to happen. Sure, I’ve used Excel for book logs, and I’ve even flirted with BI tools. But I want something more personal. More tailored. I want a program that doesn’t just track what I’ve read, but shows me how I’m reading.
The truth is, my reading speed shifts wildly. I can fly through The Hunger Games in a weekend, but with Ulysses, it feels like I’ve aged ten years by chapter three. Hemingway, despite his famously minimal style, still slows me down—not because of the vocabulary, but because of the silences between the lines. That kind of nuance doesn’t show up on a bar graph. But I want it to. I want to see the shape of my reading: genre shifts, reading slumps, maybe even gaps that whisper, “You never finished that biography, did you?” So today’s work is about evolving this project—bit by bit—into something that could actually help me change the way I read. I am going to make a Python book tracker with genre analysis.
Today’s Motivation / Challenge
This project matters because books shape who we are—and being able to map that influence with code feels like giving your brain a mirror. Today’s challenge is part introspection, part data design. How do you build a program that not only records what you read, but reveals patterns about you as a reader? That’s the kind of rabbit hole worth crawling into. Also, I finally fixed the bug that’s haunted me for days. Turns out it wasn’t a deep Python issue—it was just me calling .env instead of .venv. Classic user error.
Purpose of the Code (Object)
The script is designed to help you track your reading habits in a CSV-based log, with details like title, author, page count, genre, and the date you finished each book. It also lets you visualize your progress with bar charts and filter your reading by genre. And yes, now it can import data directly from a Notion-exported CSV file, so you’re not stuck entering everything manually like it’s 1994.
AI Prompt:
Improve a Python program that logs and visualizes books read, adds genre filtering, and supports importing from CSV. Ensure proper datetime handling for visualizations.
Functions & Features
- Log books with title, author, pages, genre, and date
- Import book data from a Notion-exported or custom CSV
- Display reading progress by month
- Filter and visualize reading stats by genre
- Prevent duplicate entries using pandas
Requirements / Setup
- Python 3.7+
- Install these packages:
pip install pandas matplotlib
Minimal Code Sample
df = pd.read_csv(FILE_NAME)
df[‘Date Finished’] = pd.to_datetime(df[‘Date Finished’], errors=’coerce’)
df[‘Month’] = df[‘Date Finished’].dt.to_period(‘M’)
monthly_pages = df.groupby(‘Month’)[‘Pages’].sum()
monthly_pages.plot(kind=’bar’)
This reads your log, groups it by month, and shows how many pages you read each month.
Notes / Lessons Learned
A project like this isn’t just about writing code—it’s about designing your data. Today, I realized that if I want to categorize my books properly, I need to structure the genre field more carefully. “Science Fiction” could mean a dystopian classic or a wild space opera. So I’m thinking of building a two-level genre system: a broad Category for reporting (like Fiction or Memoir) and a Detailed Genre for personal insights (like Time Travel Romance or Existential Cyberpunk). This kind of structure is what we use in BI dashboards at work—it keeps the data tidy while allowing for nuance.
I also made peace with PowerShell today. The mysterious failure to activate my virtual environment? Yeah… I typed .env instead of .venv. It took three days, multiple Google searches, and a small existential crisis to realize I was chasing a typo. But hey, I’ll never forget it again.
Optional Ideas for Expansion
- Create a two-tier genre system (Category + Subgenre)
- Add a reading speed calculator (pages per day) based on start/end dates
- Build a tag cloud of favorite authors or keywords
