Skip to content

Data pipeline for retrieving and transforming legislative vote data, storing in Postgres, and prepping for web apps

Notifications You must be signed in to change notification settings

reliablerascal/fl-legislation-etl

Repository files navigation

Florida Legislative Voting Database

8/23/24

Documentation Table of Contents

Detailed documentation is provided in the following sections:

  • Overview- this page
  • Database Architecture- technical overview of data structures within the database's three layers (raw, processed, app)
  • Web App and Data Visualization Guide- specific details about data prepared for web applications and ad-hoc data visualizations (work in progress)
  • ETL Script- overview of the ETL script and how to run it

External Resources (Google Docs)



Project Overview

The Jacksonville Tributary's Legislative Compass analyzes and visualizes roll call voting patterns of Florida state legislators. Key metrics include legislators' party loyalty and congressional district electorates' partisan lean and demographics. This dashboard is intended to support development of a voter guide, reporting on party polarization, and disparities between legislators and the districts they represent.

This repo contains a data pipeline which:

Project Status

This project is a work in progress, with the following work underway as of August 2024:

  • superuser journalists at partner outlets review and beta test
  • publish the web app for public use
  • document data definitions for web app data sources

See changelog.md for info on most recent updates.

Key Terminology

Following are definitions of key terminology used throughout this project:

  • Party loyalty is a legislator’s tendency to vote with or against their party. 1 = most loyal, 0 = least loyal.
  • Partisan lean is a legislative electorate’s partisanship as measured by percentage point difference between voting for Democrats vs. Republicans.
  • Party unity is a roll-call-level measure, by party, of how unified roll calls are within parties
    (# votes aligned with legislator's own party)
    -----------------------------------------
    (# votes aligned with either one party or the other)

Calculations for party loyalty are based on classifying and weighing each present (yea or nay) vote. Each vote is filed into one of six categories.

vote type descriptino loyalty weight
party line bipartisan voting with the same party's majority in roll calls supported by both parties N/A
party line partisan voting with the same party's majority in roll calls split on party lines 1
cross party voting against the same party's majority in roll calls split on party lines 0
against both parties voting against both party majorities N/A
absent nv absent or no vote N/A
other legislator's party is split evenly, etc. N/A



Guide to this Repository

Following is an overview of files in this repository:

  • data-app- data supporting web applications, in csv format
  • data-raw- raw data in JSON format, as bulk downloaded from LegiScan's API
  • docs- data dictionaries, diagrams, and documentation
  • docs- data explorations in Python, informing development of this pipeline
  • qa- includes quality assurance log and tables of data anomalies. See QA script at scripts/qa_checks.R.
  • scripts- ETL scripts



Appendix A- ETL Schematic


Figure 1: Overview of ETL pipeline, as described in Database Architecture

Appendix B- Sample Visualizations

For more info about all apps and visualizations, see Web App and Data Visualization Guide.

Voting Patterns Dashboard

Figure 2: Dashboard view of Voting Patterns web app of Senate Democrats during 2024 legislative session



District Context Web App

Figure 3: District Context web app comparing a legislator's voting record with their electorate's partisan leaning



About

Data pipeline for retrieving and transforming legislative vote data, storing in Postgres, and prepping for web apps

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published