Data AnalysisData cleaning
School Data Pipeline: Six Messy Files to One Trusted Database
Six scattered school files in five different formats, turned into one reliable, fully documented record of students, grades and attendance.
- TypeData cleaning
- RoleSolo project
- WhenNov 2026
- 10,958records read
- 6 filesin 5 formats
- 573cleaning actions logged
- 0 of 4,240checked values wrong

Highlights
- Read 10,958 records from 6 files in 5 formats (Excel, CSV, Word, PDF, log) for a fictional 240-student school with 538 planted errors
- Standardised notation, converted four grading scales to one 0–100 scale, and cross-checked the sources against each other
- Logged all 573 cleaning actions beside the raw values and sent 234 uncertain items to a prioritised review queue instead of guessing
- Result: 0 wrong values out of 4,240 checked against the answer key; a naive import got 100 of 960 scores wrong and lost 69 more
The problem
Most schools keep their information in many places at once. The registrar has an Excel list, parents fill in an online form, each department reports marks its own way (a spreadsheet, a Word document, a PDF), and the gate card reader writes a log that nobody reads. Each file has its own typical mistakes and its own way of writing a grade, so they cannot simply be added together.
Approach
To show how I handle this, I created a fictional school, Greenfield Academy (240 students, grades 9 to 12), and wrote its records into six realistic, messy files with 538 deliberate errors hidden inside. All data is synthetic; no real school, student or family is involved. I then built an automated process that reads all six files, tidies the notation, converts four different grading scales to one 0-100 scale, checks the files against each other, and produces one clean database plus an Excel workbook.
Every change is recorded next to the original value. Anything that cannot be fixed safely is never guessed: it goes to a review list with a priority and clear instructions. Checked against the hidden answer key, the cleaned data had zero wrong values. Because I planted the errors myself, that is a best case; with real files, the review list is the safety net for surprises.
Results
- 10,958 records read from 6 files in 5 formats (Excel, an online-form export, Word, PDF and a gate log)
- 537 of 538 hidden errors caught; the last one was sent for human review rather than guessed
- 0 wrong values out of 4,240 checked against the answer key (4,186 correct, 54 deliberately held back)
- A quick, unchecked import would have got 100 of 960 subject scores wrong and lost 69 more
- 234 items sent to staff for review (30 high, 124 medium, 80 low priority), each with a clear method
What this means for you
If your organisation's information lives in spreadsheets, forms, PDFs and system logs that never quite agree, the same approach can bring them together into one dependable source you can report from. You get a full record of every change made, plus a short, prioritised to-do list for the few things only your staff can confirm, instead of silent guesses hidden in your numbers.
Tools
- Python (pandas, openpyxl, python-docx, pdfplumber)
- SQLite
- Excel
Figures
Select a figure to enlarge it.

The project at a glance
This overview shows the three stages: six messy source files with their record and error counts, the cleaning steps in the middle, and the three results (a database, an 11-sheet Excel workbook and a cleaning report). The headline boxes sum it up: 240 students, 538 planted errors, 573 logged cleaning actions, 234 items for review and 0 wrong values among 4,240 checked.

The six source files and their typical problems
Each source file is listed with its size and number of planted errors, from 34 in the History PDF to 140 in the 9,519-line gate log, together with the mistakes that format is known for, such as dates typed five different ways, a grade written as "Tenth" or card swipes at 2 a.m. The takeaway: every format breaks in its own way, so each one needs its own care.

Where the problems were
This colour-coded grid places all 573 cleaning-log entries by type of problem and by file. The student register was mostly formatting issues (74), the gate log was full of invalid values, duplicates and missing data (43, 46 and 42), and scores on the wrong scale turned up in the enrollment form and the three mark files. Knowing where each kind of problem lives shows where to look first.

What was done with every problem
The chart breaks the 573 actions down by file: format tidied, value corrected or converted, row or value left out, data missing from the source, or flagged for a person. The enrollment form (148) and the gate log (150) needed the most work. Nothing was changed silently: every entry keeps the original value beside the clean one.

Four ways of writing a score, one scale at the end
On the left, how marks were typed in each file: Math and English mostly as percentages, Science mostly as fractions of 1 (153) or out of 20 (55), and History almost entirely as a 4-point GPA (223). On the right, after conversion, all four subjects sit on the same 0-100 scale with very similar averages (73.2% to 73.7%), so they can finally be compared like for like.

Quick import versus careful cleaning
Every subject score was compared with its true value from the hidden answer key. A quick import that simply trusts each file got 100 of 960 scores wrong and left 69 blank, with Science worst at 56 wrong; after careful cleaning there were 0 wrong, 944 correct and 16 held back for review. This is the clearest proof that the cleaning pays off.

The review list: what needs a person
Of the 234 entries that need a person, 30 are high priority (safety, identity, missed exams), 124 medium (the value cannot be used until checked) and 80 low (value kept, confirm later). The most common items are listed beside the practical way to resolve each, for example 21 missing gate check-outs and 8 missed exams that need a make-up date. Staff get a clear to-do list, not a mystery.

What the clean data says about results
With 909 verified scores on one scale, the four subjects can be compared for the first time: the middle score is 72 to 73% in every subject. A grade-by-subject table shows Grade 12 with the lowest average across subjects (71.6%) and Grade 11 Science the highest (75.7%). Once the data is clean, it starts answering real questions about the school.

What the gate log adds: attendance and flagged events
The 9,519 gate-log lines became 4,800 student-days of attendance and 83 flagged events, from 21 missing check-outs to 8 unknown cards and 6 swipes at odd hours. The scatter chart shows students who attend more tend to score higher (a moderate link, correlation 0.45: about 6.1 extra points of average score per 10 points of attendance). That link was built into the fictional data; the point is that it can only be measured once all the files are connected.

Conclusions
Six findings in one view: without cleaning, 169 of 960 scores would be wrong or lost; after cleaning, 0 of 4,240 values were wrong; and 537 of 538 planted errors were caught (the one exception, a misspelt name with no ID, went to review). It also shows 234 review items, with 145 of 240 students having at least one open item, attendance and achievement moving together, and four grading scales merged into one.
LINKS
Code and full documentation: https://github.com/MrThetaIII/school-data-pipeline