Every Monday you run the same MRR calculation by hand. What would it mean to name that logic and call it with one line?
Like a formula I save in a spreadsheet — except it runs on real data without me manually updating cells.
That's exactly what a function is. def compute_delta(this_week, last_week): is your formula name. The indented block is the formula body. Write it once, call it every Monday. This week you also learn to read a CSV string — the Stripe export you normally open in Excel — directly in Python without touching a file.
Wait — the CSV comes in as a string? I don't need to save a file first?
No file needed. The Pyodide runtime has no filesystem, so functions take the CSV text as an argument. That constraint is actually a gift — your functions become pure, testable, and composable. Five functions this week build the formatted report layer for the capstone investor update.
make_update_line with a docstring, named params, and returnsummarize_plancsv.DictReader + io.StringIO for robust CSV parsingjson.dumps(indent=2)Goal: by Friday your Monday MRR review is a single reusable function call.
7 lessons this week
Every Monday you run the same MRR calculation by hand. What would it mean to name that logic and call it with one line?
Like a formula I save in a spreadsheet — except it runs on real data without me manually updating cells.
That's exactly what a function is. def compute_delta(this_week, last_week): is your formula name. The indented block is the formula body. Write it once, call it every Monday. This week you also learn to read a CSV string — the Stripe export you normally open in Excel — directly in Python without touching a file.
Wait — the CSV comes in as a string? I don't need to save a file first?
No file needed. The Pyodide runtime has no filesystem, so functions take the CSV text as an argument. That constraint is actually a gift — your functions become pure, testable, and composable. Five functions this week build the formatted report layer for the capstone investor update.
make_update_line with a docstring, named params, and returnsummarize_plancsv.DictReader + io.StringIO for robust CSV parsingjson.dumps(indent=2)Goal: by Friday your Monday MRR review is a single reusable function call.