Texas Power Plans
Shopping for electricity in Texas usually means sorting a long list of plans by their price at 1,000 kWh. Texas homes don't use 1,000 kWh every month. Usage depends on home and heating type. Summer air conditioning pushes usage well past it, spring and fall drop below it. Some plans add a credit or a fee at set usage levels. One price can't show what a year costs.
Texas Power Plans is an attempt to better analyze how a plan's Electricity Facts Label translates to a monthly bill. Enter a ZIP code, and for every plan offered there, the site tries to estimate the bill for each month of the year for different types of homes.
Where the Data Comes From
The site itself only reads data from a set of json exports created from the gold layer of a small data lake. A separate program collects it, keeps an exact copy of everything it downloads, and builds the datasets the site reads. It draws on five sources:
- Power to Choose. The Public Utility Commission of Texas's list of retail plans: each plan's provider, utility, term, and prices at 500, 1,000, and 2,000 kWh, plus which utilities serve each ZIP code.
- Plan documents. Each plan's Electricity Facts Label, Terms of Service, and Your Rights as a Customer, from the providers' own websites. The Facts label is read for the plan's charges, credits, and fees.
- EIA's Residential Energy Consumption Survey 2020. How much electricity 1,016 surveyed Texas homes used in a year, by type of home and how it's heated.
- NOAA. Monthly heating and cooling degree days for Texas, used to spread a year's use across its months.
- U.S. Census Bureau. ZIP Code Tabulation Areas and the Texas outline, for the price map.
The data moves through four steps, and each step reads only the one before it:
- Collect. Download each source and keep an exact copy. One CSV from Power to Choose covers the whole state. The documents come from about 60 provider sites, fetched politely, only from links a source vouched for.
- Clean. Read the copies into tables: one row per plan, with its charges.
- Build. Join the tables into datasets: plans, estimates, maps.
- Publish. Export a file per ZIP code, and the maps, to a plans API.
Under the hood, those steps map onto a medallion architecture: a data lake in three layers, each its own S3 bucket, with tables stored as plain Parquet files.
- Bronze is Collect. It holds exactly what was fetched: CSV snapshots, API responses, and documents stored under their SHA-256 hash, plus a log row for every request. Bronze is write-once.
- Silver is Clean. Typed, conformed tables, such as offers, providers, and the charges parsed from each Facts label. Silver is a pure function of bronze plus the code, so it can be deleted and rebuilt at any time.
- Gold is Build. The consumer-ready datasets, built purely from silver. Gold is the only layer anything downstream reads.
The Publish step sits outside the lake. It reads gold and writes the JSON files the API serves.
I went with this layout because the workload is small. It's one 1.6 MB CSV a day and about 3,100 documents for a full weekly refresh, around half a gigabyte in all. The limit is being polite to provider websites. A message broker or a separate database would have added moving parts without making anything faster, so the lake is the system of record.
The biggest payoff is rebuilds. When I fix a bug in the Facts label parser or change how plans are classified, I rebuild silver and gold from bronze, and the fix applies to every past snapshot too. There are no schema migrations, and I don't need to download anything again.
Each build writes into its own folder and updates a small _latest.json pointer as its very last step, so a reader never sees a half-written build. That same file is a full manifest of gold, with every table, file, row count, and column description, and a generated views.sql lets anyone point DuckDB at the current build and query the tables by name.
API Exports
The build step produces the datasets behind every page:
- Plans: every residential offer on Power to Choose, with its prices, term, rate type, renewable share, cancellation fee, and document links.
- Plans by ZIP code: the plans offered at each ZIP, through the utilities that serve it.
- Plan charges: each plan's charges, credits, and fees, read from its Facts label.
- Price history: when each plan appears, changes price, and leaves the list.
- Home usage profiles: average use in each month for 18 kinds of homes.
- Bill estimates: each plan's estimated bill for each month and for the year, for each kind of home.
- Map shapes: Texas, its ZIP codes, and its utility areas.