Purpose
Practice material for Inflearn "Hermes × Codex Virtual Office" Section 7.3 (data cleaning and analysis). It creates a relational mart that reproduces not clean dummy data but the messy state encountered in reality. Because the seed is fixed, the instructor and all students practice with completely identical data.
Procedure
-
Run the generator.
python3 scripts/generate_mart.py --out ./magma-martUse only the standard library (no additional installation). Output:
| File | Content |
|---|---|
| customers.csv | 1,030 customer rows (including 30 duplicate registrations) |
| products.csv | 200 product rows |
| promotions.csv | 30 promotion rows |
| orders.csv | 20,060 order rows |
| order_items.csv | 33,370 order detail rows |
| schema.sql | Staging table DDL (text-centric columns that accept contamination as-is) |
| DIRT_REPORT.md | Summary of injected contamination types and counts (answer key) |
- Show the user the generation results (row counts and contamination summary), and confirm whether to load into the database. Do not load without confirmation.
- If loading is approved:
schema.sqlCreate the staging tables with and load the 5 CSVs. For Supabase, use CSV import in the dashboard Table Editor or the SQL Editor. - After loading, query the row count of each table, verify that it matches the CSV row count, and report it.
Rules
--seedDo not arbitrarily change the value (default 42). Changing it will cause the lecture screen and student data to diverge.- DIRT_REPORT.md is the answer keyfor the cleaning practice. Do not show it to learners before the practice.
- Do not fix contamination in advance during the generation stage — fixing it is the practice itself.
- All generated data is fictional. It is unrelated to real people or business names and is not personal information.
List of contamination patterns (teaching points)
Duplicate customers (notation variants) · Missing phone numbers · Non-normalized region notation (서울/SEOUL/서울특별시) · Email contamination · Negative prices · Price outliers (unit errors) · Missing categories · Mixed 4 date formats · Future dates · Non-normalized channel notation (online/ONLINE/온라인) · Duplicate order rows · Orphan product FK · Negative quantities · Mixed 4 amount notations (₩, comma, '원', decimal point)