Before loading a partner's CSV, check its header against the columns the table expects.
Write column_drift(expected, header). Both are lists of column names. Compare names after removing surrounding spaces and lower-casing them — " Order_ID" and "order_id" are the same column. Return a dict with three lists of cleaned names, each sorted ascending:
- •
"missing" — expected columns the header doesn't have; - •
"unexpected" — header columns that aren't expected; - •
"duplicated" — cleaned names that appear more than once in the header.
Python 3.13 in your browser — the standard library plus pandas and numpy; no pip installs.