A small neighborhood bakery was losing half a workday to copy-paste. One Python script fixed it in an afternoon.
Golden Crust Bakery (a fictional client) takes online orders through their website, which arrive as confirmation emails and a daily CSV export. Every morning, the owner opened each email, copied the customer name, items, and quantities into a spreadsheet by hand, then retyped the totals for the baking schedule.
It took about 4 hours a week. Worse, manual copying caused mistakes: wrong quantities, missed custom notes (like "no nuts"), and the occasional duplicated order.
A single Python script that runs every morning. It reads the order CSV export, cleans up the data, and writes a tidy daily baking summary. The owner now opens one file instead of forty emails.
| Customer | Items | Qty | Notes |
|---|---|---|---|
| Jonh Smith | Sourdogh loaf | 2 | |
| Maria G. | croissant x6 box | 1 | no nuts?? |
| Jonh Smith | Sourdogh loaf | 2 | duplicate? |
| Lee | bagel | 12 | |
| Priya | choc cookiess | 24 |
| Customer | Items | Qty | Notes |
|---|---|---|---|
| John Smith | Sourdough loaf | 4 | |
| Maria G. | Croissant box (6) | 1 | No nuts |
| Lee | Bagel (dozen) | 1 | |
| Priya | Chocolate cookies | 24 |
The actual script is short on purpose. It uses only Python's built-in libraries, so there is nothing to install and nothing that can break on update day.
# daily_orders.py, reads orders.csv, writes baking_summary.csv import csv from collections import defaultdict FIXES = {"jonh": "John", "sourdogh": "Sourdough", "cookiess": "cookies", "choc": "Chocolate"} def clean(text): text = text.strip() for wrong, right in FIXES.items(): text = text.replace(wrong, right).replace(wrong.title(), right) return text orders = defaultdict(lambda: {"qty": 0, "notes": ""}) with open("orders.csv") as f: for row in csv.DictReader(f): key = (clean(row["customer"]), clean(row["item"])) orders[key]["qty"] += int(row["qty"]) if row["notes"].strip(): orders[key]["notes"] = clean(row["notes"]) with open("baking_summary.csv", "w", newline="") as f: w = csv.writer(f) w.writerow(["Customer", "Item", "Qty", "Notes"]) for (customer, item), d in sorted(orders.items()): w.writerow([customer, item, d["qty"], d["notes"]]) print(f"Done: {len(orders)} unique orders summarized.")
The bakery's morning routine went from an hour of careful copy-paste to opening one file. Order errors dropped to zero in the first month, because the script merges duplicates and standardizes names instead of relying on tired eyes at 6 AM.
Total build time: one afternoon. Total maintenance since: none.
If a repetitive task is eating your week, a small script can probably kill it. This is a demo case study for a fictional client.