CodeAgeBy Sitezack
Final project: data pipelineFrom raw data to report0 XP
Chapter progress0/6

Lesson 6 of 6

Final project: the complete pipeline

Final assembly: a pipeline(raw) function chaining cleaning → parsing → validation → aggregation, absorbing corrupted lines with try/except.

It's the architecture of every real ETL. Finish this project and the Season 3 legend badge is yours. 👑

try:
    score = int(parts[1])
except ValueError:
    continue

🎯 Exercise

Write pipeline(raw): for each non-empty line of raw (splitlines), split on the comma, clean the name with clean (provided), convert the score with int skipping the line if conversion fails (try/except ValueError), and keep the record only if the name is not empty and the score is >= 0. Return {"count": number, "average": mean rounded to 2 decimals, "top": name of the best score} — and {"count": 0, "average": 0, "top": ""} if nothing survives. Print pipeline(RAW).

PRO lesson

This advanced chapter is part of CodeAge PRO. Unlock it to keep your adventure going.

Discover PRO