Technical
The Python Script That Replaced My Weekly Status Report
I used to spend ninety minutes every Friday writing a weekly status update for a retainer client. A forty line Python script now produces a better version in under a minute. The approach generalizes to any repeated report, and the key insight is: the template should live in code, not in your head.
The Inputs
- Git log from all relevant repos, last seven days
- Trello cards moved to Done since last Friday
- A short freeform note I add each morning
Three inputs, one output. The script stitches them into a markdown report with consistent sections.
The Script Shape
from pathlib import Path
import subprocess, datetime
def git_log(repo, since):
out = subprocess.check_output(
['git', '-C', repo, 'log', f'--since={since}', '--pretty=%s']
)
return out.decode().splitlines()
def build_report(notes, commits, cards):
return f"""# Weekly Update {datetime.date.today()}\n\n"""The full script is under fifty lines. It produces a markdown file I paste into email.
Why This Works
The report used to be slow because I was deciding every week what to include. The script makes that decision once, in code. Every week is the same shape. Small variations go in the freeform note. The client gets a more consistent artifact and I get ninety minutes back.
The Trello Part
I use the Trello REST API to pull cards by list and date. Filtering to cards with updates in the last seven days produces a clean Done column snapshot. No manual copy paste.
import urllib.request, json
url = f'https://api.trello.com/1/lists/{LIST_ID}/cards?key={KEY}&token={TOKEN}'
cards = json.loads(urllib.request.urlopen(url).read())Two lines. Dependency free. Runs anywhere Python runs.
The Template Discipline
The script enforces a structure I used to break every week: always lead with outcomes, not activities. The code template simply does not have an activities-first section. Decisions baked into code cost nothing to enforce.
What I Cut
The old report had a section called Next Week Plans. I deleted it. Nobody read it, I rewrote it every Monday anyway, and the client only cared about done work. The script enforces the cut. My willpower did not.
See the Trello REST API docs for the endpoints I use.
The Pattern I Keep Reusing
The shape of this script generalizes. Any recurring deliverable can follow the same pattern: inputs from a few stable sources, a template in code, one command to produce the output. Monthly invoices, quarterly retrospectives, weekly standup notes, daily client updates. I now have six of these scripts in rotation and each one replaced hours of repeated work.
The Client Reaction
Clients have noticed the consistency. Not because they know there is a script, but because the reports land at the same time every week with the same structure. Reliability is a product feature in consulting. The script is an invisible infrastructure investment that shows up in the client relationship as trust.
The Real Lesson
The lesson is not about Python. It is about encoding your workflow decisions in code the first time you notice a pattern. If you are doing something weekly and it takes more than fifteen minutes, it is worth an afternoon of scripting. The payback is immediate and permanent.
RELATED READING
The Consulting Shift I Am Making In Year Two
After a year of writing and building, my consulting practice is changing shape. Shorter engagements. Sharper outcomes.
ReadThe Frontend Shift: Shipping Less JavaScript In Year Two
A year ago I reached for Next.js for everything. This year I often reach for nothing.
ReadThe Serverless Lesson I Would Write On A Sticky Note
After a year of shipping serverless projects, one rule explains most of the wins and all of the losses.
Read