teadata
A Python library for connecting Texas school data across sources and years, with district and campus models, a query language, and geographic analysis.
A shared data model for Texas schools
Texas school research often starts with several exports that use different identifiers, reporting years, and layouts. I built teadata to bring those records into a common model, so each new question does not need a new set of joins.
The library represents districts and campuses as Python objects with canonical TEA identifiers. Its query language lets me move from a district to its campuses, filter their attributes, and combine that work with transfer flows and geographic relationships.
What I built
I designed the district and campus models, the composable query API, and the enrichment and persistence layers. The code includes support for TAPR and accountability records, PEIMS enrollment, transfer data, and geographic boundaries. PostgreSQL and SQLAlchemy support persistent data, while saved snapshots make a research dataset easier to reuse.
This library is part of my work at Data for Public Education. It gives research scripts and web applications a shared way to refer to schools, rather than making every project interpret the raw exports again.
A small example you can inspect
The example below uses a workbook published in the repository. I loaded its records into teadata, ran district and campus queries in Python, and exported the results for this page. The controls show how a research question becomes a short query and a table someone else can read.
2025 ratings · 2023–24 staffing
Explore a published campus dataset
This example connects campus identifiers, district membership, accountability ratings, and staffing data. Choose a district to see up to ten campuses with the highest share of beginning teachers.
The source workbook contains 795 selected D/F-rated district campuses across 217 districts. It is not a statewide campus inventory. The two measures cover different reporting years; this comparison does not establish a cause of a school’s rating.
10 campuses shown for Austin ISD.
| Campus | TEA number | 2025 rating | Beginning teachers, 2023–24 |
|---|---|---|---|
| GENERAL MARSHALL MIDDLE | 227901063 | D | 48.0% |
| OAK SPRINGS EL | 227901125 | F | 39.7% |
| GOVALLE EL | 227901116 | F | 37.3% |
| DAWSON EL | 227901114 | F | 36.9% |
| JORDAN EL | 227901178 | F | 35.3% |
| MARTIN MIDDLE | 227901051 | F | 29.9% |
| HOUSTON EL | 227901162 | F | 27.4% |
| DOBIE MIDDLE | 227901055 | F | 26.9% |
| MCBEE EL | 227901165 | D | 23.3% |
| WEBB MIDDLE | 227901053 | F | 23.2% |
Run the same query in Python
campuses = engine >> ("district", "Austin ISD") >> ("campuses_in",)
result = (campuses
>> ("filter", lambda c: ("all" == "all" or c.rating == "all")
and c.beginning_teachers_pct is not None
and c.beginning_teachers_pct >= 0)
>> ("sort", lambda c: c.campus_number)
>> ("sort", lambda c: c.beginning_teachers_pct, True)
>> ("take", 10))Use the export script below to load the original workbook into teadata’s district and campus models.
Python/teadata produced this snapshot. The browser filters the exported records; it does not run the Python engine. Twelve reference queries are checked against the browser’s results.