Skip to content

Latest commit

 

History

History
66 lines (56 loc) · 3.12 KB

README.md

File metadata and controls

66 lines (56 loc) · 3.12 KB

Statistical Districts

A program for creating an interactive map of Census data for select Congressional Districts, Texas House Districts, and Texas Senate Districts.

Required Python Libraries

Installation

  1. Install Python libraries:
pip install geopandas
pip install tornado
pip install census
pip install us
pip install matplotlib
pip install openpyxl
pip install tqdm
  1. Get API keys
  1. Set variables in settings files:
  • Rename example.settings.ini to settings.ini; and put your Census API in this file
  • Rename static/js/example.settings.js to static/js/settings.js; and put your Google Maps API key in in this file

Usage

  1. Build the stats from the Census Bureau with python statbuilder.py
  • Build the stats for a particular year:
    • statbuilder.py --year 2014
  • Build the stats for a given Congressional District:
    • python statbuilder.py --state 48 --district 7
  • Build the stats for a given Texas House District:
    • python statbuilder.py --state 48 --district 134 --leg-body "STATE-REP"
  • Build the stats for a given Texas Senate District
    • python statbuilder.py --state 48 --district 17 --leg-body "STATE-SEN"
  1. Run the webserver python statserver.py

  2. View results in your web browser by going to localhost:8000

Open Source Licenses

Disclaimer

This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.