CSV cleanup should explain what it rejected. I built a small Python CLI as a personal project usi...CSV cleanup should explain what it rejected. I built a small Python CLI as a personal project usi...
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
I built a small Python CLI as a personal project using synthetic data. Its five-row example produces three accepted rows and two rejected rows, with a separate report naming each rejection reason.
The rules are explicit: trim surrounding whitespace, keep the first occurrence of each nonempty record ID, and reject missing or duplicate IDs. IDs stay as strings, so leading zeros survive. Python’s CSV parser handles quoted commas correctly. Email domains are lowercased while local-part casing is preserved; this does not verify email deliverability.
Rerunning with existing output filenames fails instead of overwriting them. Malformed input is rejected before output files are created. The repository includes sample inputs, expected outputs, five CLI tests, and run instructions.
Malware in a WordPress backup, disguised as a photo
A client wanted me to restore a WordPress site from a zip backup and asked for one thing before paying: a screenshot of the site running on my own computer, with localhost in the address bar.
Loading a WordPress site runs its PHP on whatever machine serves it. So I read the zip with a script first and didn't extract it.
WordPress core matched the official checksums. In wp-content/mu-plugins, though, there was a file that looked for a 4.6 MB "JPEG" in uploads, renamed it to .exe and tried nine ways to launch it. The first two bytes of that "JPEG" were MZ, which is how a Windows executable starts. Opening localhost for the screenshot would have been enough to run it.
My first script missed it because it trusted file extensions. Now it reads the first bytes of every file.
The MZ check is such a good catch. Worth adding for anyone restoring sites: mu-plugins run on every request and can't be switched off from the dashboard, so they're a favourite hiding spot. Did the client ever reply after you flagged it?
Incomplete records make it harder to find the right people. Datalier turns scattered account data into clear insights, helping go to market teams focus on the right conversations.