A program for creating an interactive map of Census data for select Congressional Districts, Texas House Districts, and Texas Senate Districts.
- Install Python libraries:
pip install geopandas
pip install tornado
pip install census
pip install us
pip install matplotlib
pip install openpyxl
pip install tqdm
- Get API keys
- Set variables in settings files:
- Rename
example.settings.ini
tosettings.ini
; and put your Census API in this file - Rename
static/js/example.settings.js
tostatic/js/settings.js
; and put your Google Maps API key in in this file
- 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"
-
Run the webserver
python statserver.py
-
View results in your web browser by going to localhost:8000
- Bootstrap by Twitter
- census by DataMade
- Chart.js by Nick Downie
- code excerpts by Google
- geopandas by GeoPandas developers
- hamburgers by Jonathan Suh
- matplotlib by Matplot Lib Development Team et al.
- slideout.js by Mango
- tornado by The Tornado Authors
- us by Sunlight Labs
- tqdm by various contributors
- openpyxl by openpyxl
This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau.