j40-cejst-2/score
Jorge Escobar c8a7f81f7c
habemus score! 🎉 (#185)
* habemus score!

* etl process for score

* small typo

* adding in score percentiles

Co-authored-by: lucasmbrown-usds <lucas.m.brown@omb.eop.gov>
2021-06-18 10:16:19 -04:00
..
data habemus score! 🎉 (#185) 2021-06-18 10:16:19 -04:00
etl Starting etl for score (#141) 2021-06-16 13:47:27 -04:00
ipython habemus score! 🎉 (#185) 2021-06-18 10:16:19 -04:00
scripts habemus score! 🎉 (#185) 2021-06-18 10:16:19 -04:00
__init__.py ACS data baked in for map (#153) 2021-06-17 18:12:39 -04:00
README.md Setup Census Block Group download and GeoJSON encoding (#122) 2021-06-15 16:36:49 -04:00
requirements.txt Setup Census Block Group download and GeoJSON encoding (#122) 2021-06-15 16:36:49 -04:00

Justice 40 Score generator

Setup

  • Start a terminal
  • Make sure you have Python 3.9 installed: python -V or python3 -V
  • Create a virtualenv in this folder: python -m venv venv
  • Activate the virtualenv
    • Windows: ./venv/Scripts/activate
    • Mac/Linux: source venv/bin/activate
  • Install packages: pip install -r requirements.txt
    • If you are a Windows user, you might need to install Build Tools for Visual Studio. Instructions here

Running the Jupyter notebook

  • Start a terminal
  • Change to this directory (i.e. cd score)
  • Activate your virtualenv (see above)
  • Type jupyter notebook. Your browser should open with a Jupyter Notebook tab

Downloading Census Block Groups GeoJSON and Generating CBG CSVs

  • Make sure you have Docker running in your machine
  • Start a terminal
  • Change to this directory (i.e. cd score)
  • Activate your virtualenv (see above)
  • Run python scripts/download_cbg.py Note: Census files are not kept in the repository and the download directories are ignored by Git

Generating mbtiles

  • Change to this directory (i.e. cd score)
  • Activate your virtualenv (see above)
  • Run the following script: python .\scripts\generate_mbtiles.py

Serve the map locally

  • Run: docker run --rm -it -v ${PWD}/data/tiles:/data -p 8080:80 klokantech/tileserver-gl