← Back to Projects
Data Pipeline with Tests
Build a robust local data pipeline that reads messy CSVs, applies an algorithmic transformation, validates data, and writes clean JSON.
What you'll learn
- Reading, parsing, and cleaning messy tabular data
- Implementing a core algorithmic logic (e.g., graph search to link related records)
- Writing strict, robust unit tests to verify algorithmic correctness
- Outputting validated data into JSON
Architecture
Raw CSV
→ Pandas Data Cleaning (handle nulls, formats)
→ Algorithmic Transformation (DSA Core)
→ Validation (Pydantic / assert checks)
→ Clean JSON Output
Steps
- Find a messy real-world CSV dataset (e.g., flight delays, housing data, or sales records).
- Write a Python script to ingest the dataset using Pandas or the standard
csvlibrary. - Implement a non-trivial algorithmic step: for example, group and link records using a graph algorithm, or calculate a dynamic-programming based optimal sequence.
- Crucial Step: Write at least 5 unit tests using
pytestspecifically to test your core algorithmic function in isolation. - Validate the final output structure and write it to a well-formatted JSON file.
- Refactor the script into modular functions (
extract,transform,load).