Before you start

Bar and line charts displayed on a laptop.
Antoni Shkraba · Pexels License
Intermediate · Practise30 min4 steps

Validate a CSV with Python before automating tasks

Run a local example to detect duplicate identifiers and incomplete rows without changing the original file or installing packages.

What you will build

  • A reproducible report: two valid rows, one duplicate and one incomplete row.

What you need

Python 3 with the standard csv and pathlib modules; a text editor and terminal.

Know how to open a folder in a terminal. No API or paid account required.

  1. 1. Prepare the working folder
  2. 2. Inspect the data before running
  3. 3. Run and compare the report
  4. 4. Make one controlled change