Before we write a single line of code this week — tell me how you've been handling data files at the logistics company. What does the pipeline look like when a report lands in your inbox?
Depends on the file. If it's JSON, I do json.loads() on each line. I got that from Stack Overflow. If it's a CSV, I open it, do line.split(','), and pray nobody put a comma inside a value field. I have been burned by that twice. Once with a location field that said "Portland, Oregon". Once with an error message that had a comma in it. Both times I had to rewrite the whole parser.
You just described two bugs that Python already fixed for you before you were born. csv.DictReader handles quoted commas. json.loads() is correct but you are using only a fraction of what the json module can do. And neither of us has mentioned pathlib yet, which means you are probably writing path strings as raw text and joining them with os.path.join().
I write '/var/logs/' + filename. Which I know is wrong. I just didn't know what the right thing was.
This week is the right thing. Five modules — json, csv, pathlib, os/sys, and shutil — and every one of them directly applies to the log pipeline Diane has handed you. By Day 8 you will be reading JSON log entries, parsing metrics from CSV exports, navigating the log directory with code that reads like a GPS instruction, and archiving old logs with two lines instead of twenty. These modules do not introduce new programming concepts. You already know how to write functions, process lists, and filter dicts. This week is about swapping out the manual tools you have been using for the ones Python ships with.
How many modules are we talking about total? In the whole standard library?
About 200 built-in modules. The average working developer uses roughly fifteen of them with any regularity. This week covers five of those fifteen. By the end of this track you will know all fifteen.
The Python standard library is a decision made at language design time: ship the language with enough tools that a developer can do real work without touching a package manager. Every Python installation includes 200+ modules across categories — file I/O, networking, data formats, datetime handling, text processing, cryptography, testing, and more. The design philosophy is batteries included.
For most developers, this goes unnoticed. You learn import json from a Stack Overflow answer and never think about what else ships in the box. You pip-install a CSV library because someone recommended it, even though csv is already there. You write os.path.join() chains from memory without knowing that pathlib replaced that pattern in Python 3.4.
The five modules in Week 1 share a common theme: they exist because raw file handling is fragile. Every format has edge cases — JSON has unicode escape sequences, CSV has quoted delimiters, filesystem paths have platform-specific separators. The stdlib modules encode the solutions to these edge cases so that you do not have to rediscover them. csv.DictReader knows about RFC 4180 quoting rules. pathlib.Path knows about Windows backslashes vs Unix forward slashes. shutil.copy2 preserves file metadata that a naive read/write loop would drop.
The practical consequence: the bugs Maya has been hitting — the comma-in-a-CSV-field bug, the path-separator bug on Windows, the json.dumps output that is unreadable without formatting — are not her bugs. They are solved problems. The week ahead is about learning where the solutions already live.
Sign up to save your notes.
Before we write a single line of code this week — tell me how you've been handling data files at the logistics company. What does the pipeline look like when a report lands in your inbox?
Depends on the file. If it's JSON, I do json.loads() on each line. I got that from Stack Overflow. If it's a CSV, I open it, do line.split(','), and pray nobody put a comma inside a value field. I have been burned by that twice. Once with a location field that said "Portland, Oregon". Once with an error message that had a comma in it. Both times I had to rewrite the whole parser.
You just described two bugs that Python already fixed for you before you were born. csv.DictReader handles quoted commas. json.loads() is correct but you are using only a fraction of what the json module can do. And neither of us has mentioned pathlib yet, which means you are probably writing path strings as raw text and joining them with os.path.join().
I write '/var/logs/' + filename. Which I know is wrong. I just didn't know what the right thing was.
This week is the right thing. Five modules — json, csv, pathlib, os/sys, and shutil — and every one of them directly applies to the log pipeline Diane has handed you. By Day 8 you will be reading JSON log entries, parsing metrics from CSV exports, navigating the log directory with code that reads like a GPS instruction, and archiving old logs with two lines instead of twenty. These modules do not introduce new programming concepts. You already know how to write functions, process lists, and filter dicts. This week is about swapping out the manual tools you have been using for the ones Python ships with.
How many modules are we talking about total? In the whole standard library?
About 200 built-in modules. The average working developer uses roughly fifteen of them with any regularity. This week covers five of those fifteen. By the end of this track you will know all fifteen.
The Python standard library is a decision made at language design time: ship the language with enough tools that a developer can do real work without touching a package manager. Every Python installation includes 200+ modules across categories — file I/O, networking, data formats, datetime handling, text processing, cryptography, testing, and more. The design philosophy is batteries included.
For most developers, this goes unnoticed. You learn import json from a Stack Overflow answer and never think about what else ships in the box. You pip-install a CSV library because someone recommended it, even though csv is already there. You write os.path.join() chains from memory without knowing that pathlib replaced that pattern in Python 3.4.
The five modules in Week 1 share a common theme: they exist because raw file handling is fragile. Every format has edge cases — JSON has unicode escape sequences, CSV has quoted delimiters, filesystem paths have platform-specific separators. The stdlib modules encode the solutions to these edge cases so that you do not have to rediscover them. csv.DictReader knows about RFC 4180 quoting rules. pathlib.Path knows about Windows backslashes vs Unix forward slashes. shutil.copy2 preserves file metadata that a naive read/write loop would drop.
The practical consequence: the bugs Maya has been hitting — the comma-in-a-CSV-field bug, the path-separator bug on Windows, the json.dumps output that is unreadable without formatting — are not her bugs. They are solved problems. The week ahead is about learning where the solutions already live.