DEV Community

Cess Mbugua
Cess Mbugua

Posted on

Day 9 of 60: Today I built something cool and then spent just as long trying to push it to GitHub.

Today I built something cool and then spent just as long trying to push it to GitHub.
Both experiences taught me something valuable.


## What I Built

An AI Batch Document Classifier: a Python script that scans a folder of documents, sends each one to Claude API, and produces a master JSON report classifying every document by category, urgency, required action, and whether a deadline was mentioned. Urgent documents are surfaced first.

The real world problem it solves: manually reading 30+ documents to triage them takes hours. This script does it in under 60 seconds.


## How the Pipeline Works

**scan_documents()** finds all .txt files in documents/ folder
↓
**read_document()** reads full content of each file
↓
**classify_document()** sends content to Claude API → returns JSON
↓
**json.loads()** converts response into Python dictionary
↓
**save_results()** sorts by urgency → writes master JSON → prints summary
Enter fullscreen mode Exit fullscreen mode

## Document Categories
contract | complaint | invoice | policy | meeting_notes | other

Urgency Levels

urgent | standard | low


## What I Learned About Reading Python Code

Today something clicked that hasn't before: how to read a Python script by sections rather than line by line.

Every professional Python script tells a story:

  • Imports: what tools the script needs
  • Functions: what jobs each section does
  • main(): how all the jobs connect into a pipeline

Reading it section by section instead of trying to understand every line at once made the whole structure suddenly make sense.

The GitHub Struggle Was Real

Pushing to GitHub today was an unexpected lesson in itself. My .env file was committed in the first push but GitHub's push protection blocked it immediately.

What followed was a deep dive into:

  • git rm --cached, removing files from tracking
  • git filter-branch, rewriting commit history to scrub secrets
  • .gitignore, understanding why it needs to be set up correctly before the first commit
  • Regenerating exposed API keys immediately

Biggest lesson: set up your .gitignore before your first commit. Not after. Before.


🔗 Full project on GitHub → https://github.com/mbuguacessy-glitch/ai-batch-document-classifier

Day 9 of my 60-day public AI automation build challenge. Learning by doing,
 every mistake included.

51 more to go. 🚀

python #claudeapi #automation #learninpublic #buildinpublic #github #100DaysOfCode

Top comments (0)