Build a small CSV quality checker
Translate validation rules into tested code
← All assignments
Assignment preview
This is the complete public sample: the brief, source notes, deliverables, checks, and review criteria below. Download the same materials to work offline. Confirmed paid assignment terms and submission tools are available only in the invited portal.
The brief
Write a Python or JavaScript command-line tool that validates a fictional assignment CSV. It must print valid rows and row-specific errors without silently fixing data. Use a CSV library so quoted values work correctly.
Your source packet
Fictional source notes for this exercise. No outside client data.
Required headers: id,minutes,score. ID must be nonempty and unique. Minutes must be a positive integer; score must be an integer from 0 to 100 inclusive. Blank scores are invalid. Example: id,minutes,score A01,30,80 A02,0,90 A01,20,70 A03,15, Expected categories: one valid row; invalid minutes; duplicate ID; missing score. Header errors should stop processing with a clear message.
What to deliver
- Source code and a README with input/output examples
- Tests for valid input, duplicate IDs, zero minutes, blank scores, and quoted CSV fields
- A short note explaining one design tradeoff
Check your understanding
- Why does splitting every line on commas fail for some valid CSV files?
- What happens if the header row is missing?