You have twenty-plus working functions. What separates a toolkit from a tool? What's missing?
Configuration. Right now everything's hardcoded — "filter for ERROR" is baked into the caller. A real tool takes flags: --level ERROR --limit 100 from the command line.
Right. This week is argparse — Python's standard-library flag parser — plus the composition layer: apply-config, validation, table rendering, and on Day 28 a capstone function that wires everything together end-to-end.
Is argparse the production-grade approach? I've seen tutorials use it but never really understood it.
It's what every serious Python CLI uses. You register the flags your tool accepts, call parser.parse_args(), and get back a namespace object with typed attributes. Strings, ints, booleans — all coerced at parse time. Cleaner than walking sys.argv by hand.
argparse.ArgumentParserre.compile and .matchrun_log_report chains parse, filter, count, formatGoal: by Friday you can ship a CLI tool that a teammate could run from any terminal.
7 lessons this week
You have twenty-plus working functions. What separates a toolkit from a tool? What's missing?
Configuration. Right now everything's hardcoded — "filter for ERROR" is baked into the caller. A real tool takes flags: --level ERROR --limit 100 from the command line.
Right. This week is argparse — Python's standard-library flag parser — plus the composition layer: apply-config, validation, table rendering, and on Day 28 a capstone function that wires everything together end-to-end.
Is argparse the production-grade approach? I've seen tutorials use it but never really understood it.
It's what every serious Python CLI uses. You register the flags your tool accepts, call parser.parse_args(), and get back a namespace object with typed attributes. Strings, ints, booleans — all coerced at parse time. Cleaner than walking sys.argv by hand.
argparse.ArgumentParserre.compile and .matchrun_log_report chains parse, filter, count, formatGoal: by Friday you can ship a CLI tool that a teammate could run from any terminal.