Add LegiScan legislation ingestion and analysis queries

Adds ingest_legiscan.py to pull all US state + federal bills (2016-2026)
from the LegiScan API into legiscan_sessions and legiscan_bills tables.
Bills are keyword-tagged across 8 research categories (data_center,
ratepayer_protection, large_load, grid_impact, tax_incentive, etc.).
Loads ~1.3M bills; ~60K tagged relevant. Adds query_legiscan_bills.sql
with pre-built analysis queries including state/DC joins. Updates
database-tables.md, README.md, and research-ideas.md accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 21:30:31 -07:00
parent 46c8c58545
commit 4525ea3f97
5 changed files with 1046 additions and 1 deletions

View File

@@ -566,4 +566,58 @@ If you're interested in collaborating on any of these research directions, pleas
---
## Legislative Analysis (LegiScan Data)
**Status**: Data loaded — 1.3M bills across all US states + federal, 20162026; ~60K tagged relevant.
**Tables**: `legiscan_sessions`, `legiscan_bills`
**Query file**: `query_legiscan_bills.sql`
### Research Questions
**1. Ratepayer Cost Shifting**
Do states with high data center density show more legislative activity on ratepayer protection?
- Join `legiscan_bills WHERE 'ratepayer_protection' = ANY(relevance_tags)` to `master_data_centers` counts by state
- Test correlation between DC concentration and # of ratepayer bills introduced/passed
- Compare outcomes: do high-DC states pass or fail more ratepayer protections?
**2. Data Center Legislative Wave**
Is there a measurable increase in DC-specific legislation after 2022 (AI boom)?
- Trend `data_center` and `large_load` tagged bills by `year_start`
- Cross-reference with major AI facility announcements (20222025)
**3. Tax Incentive Geography**
Which states enacted tax incentives that may have influenced DC location decisions?
- `tax_incentive` bills with `status IN (4,8)` (passed/chaptered)
- Overlay with `master_data_centers` growth by state over the same period
- Candidate for difference-in-differences analysis
**4. Grid Interconnection Policy**
Do states with `grid_impact` legislation show different EIA capacity expansion patterns?
- Join relevant bills to `energy_eia_operating_generator_capacity_flat` by state
- Look for correlations between grid policy activity and nameplate MW additions
**5. Siting Preemption vs. Local Control**
Are states passing bills to streamline or restrict local siting authority?
- Full-text search within `siting_permitting` bills for "preemption" vs. "local control"
- Map bill outcomes by state political environment (cross-ref RDH vote data)
### Suggested Joins
```sql
-- States with DCs and legislative activity by topic
SELECT
dc.state,
COUNT(DISTINCT dc.id) AS data_centers,
COUNT(DISTINCT lb.bill_id) FILTER (WHERE 'data_center' = ANY(relevance_tags)) AS dc_bills,
COUNT(DISTINCT lb.bill_id) FILTER (WHERE 'ratepayer_protection'= ANY(relevance_tags)) AS ratepayer_bills,
COUNT(DISTINCT lb.bill_id) FILTER (WHERE 'tax_incentive' = ANY(relevance_tags)
AND lb.status IN (4,8)) AS tax_incentives_passed
FROM master_data_centers dc
LEFT JOIN legiscan_bills lb ON dc.state = lb.state AND lb.is_relevant
GROUP BY dc.state
ORDER BY data_centers DESC;
```
---
**Last Updated**: May 2026