Messy CSV exports are a tax on every data task: stray whitespace, duplicate rows, inconsistent headers, files too big to open. You don't always need pandas for this — Python's built-in csv module handles most of it with zero dependencies and code you can drop on any machine.
Here are three small patterns I reach for constantly.
1. Clean: dedupe, trim, fix headers
import csv
def clean(path, out):






