data-creative / state_legislatures

Summary data about state legislative bodies

Home Page:http://dwillis.github.io/state_legislatures/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

State Legislatures

This repository contains summary data about state legislative bodies as compiled by the National Conference of State Legislatures (NCSL) from 2009-2016, including partisan compositions and gender compositions.

Data in this repository has been transformed and validated using automated, repeatable processes.

Usage

Download this repository to use server-side, or make client-side requests to the raw versions of any file in the data directory.

Contributing

When new data is posted by NCSL, add the source url to lib/ncsl/gender_composition.rb or lib/ncsl/party_composition.rb, then run the appropriate conversion process.

Prerequisites

Install homebrew, git, ruby and bundler.

Install pdftotext command line utility. If on a Mac, install pdftotext by installing poppler:

brew install poppler

Installation

Download the source code and install package dependencies:

git clone git@github.com:dwillis/state_legislatures.git
cd state_legislatures
bundle install

Conversion Process

Download party composition pdf files and convert to machine-readable formats:

ruby script/etl_party_compositions.rb

Scrape gender composition html tables and convert to machine-readable formats:

ruby script/etl_gender_compositions.rb

About

Summary data about state legislative bodies

http://dwillis.github.io/state_legislatures/


Languages

Language:Ruby 100.0%