Skip to content

teadata

A Python library for connecting Texas school data across sources and years, with district and campus models, a query language, and geographic analysis.

Stack
Python, SQLAlchemy, PostgreSQL, GeoPandas
Year
2026
Status
Active
Source code
adpena/teadata
Example
Explore campus data

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.

CampusTEA number2025 ratingBeginning teachers, 2023–24
GENERAL MARSHALL MIDDLE227901063D48.0%
OAK SPRINGS EL227901125F39.7%
GOVALLE EL227901116F37.3%
DAWSON EL227901114F36.9%
JORDAN EL227901178F35.3%
MARTIN MIDDLE227901051F29.9%
HOUSTON EL227901162F27.4%
DOBIE MIDDLE227901055F26.9%
MCBEE EL227901165D23.3%
WEBB MIDDLE227901053F23.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.