Data Pipelines That
Actually Run.
Two Python scripts on the same music store data. The first pulls records from five tables, calculates revenue by country, and draws a bar chart. The second generates a full sales report — top customers, rep performance, KPIs — and exports it as a CSV. The code is editable so you can change it and re-run it.
Dataset: Chinook (digital music store). Scripts and pipeline logic are my own.
Select a script to run
Pick a script, read the comments in the code to understand what each part does, then click Run. You can edit the code directly and re-run it to experiment.
Techniques used
What each concept means, in plain English.
-
ETL Extract, Transform, Load
A standard data workflow: first pull the raw data (Extract), then clean and reshape it (Transform), then output it somewhere useful (Load) — like a chart or a CSV file. Both scripts here follow this pattern.
-
sqlite3 Python's built-in database module
Lets Python talk directly to a SQLite database file. Used here to run JOIN queries across five tables and pull the exact data each script needs — no external database server required.
-
csv module Reading and writing CSV files
Python's built-in tool for exporting data as a spreadsheet-ready file. The report generator writes each row of results into a CSV that can be opened directly in Excel or Google Sheets.
-
collections.defaultdict Grouping data in Python
A Python structure that makes it easy to group and accumulate values — like totalling revenue per country as you loop through thousands of rows, without writing extra checks for missing keys.