datamade/illinois-sunshine

Name: illinois-sunshine

Owner: datamade

Description: :sunny: Illinois Sunshine. Keep an eye on money in Illinois politics.

Created: 2016-05-13 18:49:56.0

Updated: 2017-07-31 20:37:46.0

Pushed: 2016-07-13 14:27:28.0

Homepage: http://illinoissunshine.org/

Size: 1231

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Illinois Sunshine

Keep an eye on money in Illinois politics. Built for the Illinois Campaign for Political Reform.

Setup

Install OS level dependencies:

Install app requirements

We recommend using virtualenv and virtualenvwrapper for working in a virtualized development environment. Read how to set up virtualenv.

Once you have virtualenvwrapper set up,

rtualenv illinois-sunshine
clone https://github.com/datamade/illinois-sunshine.git
llinois-sunshine
install -r requirements.txt
unshine/app_config.py.example sunshine/app_config.py

In app_config.py, put your Postgres user in DB_USER and password in DB_PW.

NOTE: Mac users might need this lxml workaround.

Afterwards, whenever you want to work on illinois-sunshine,

on illinois-sunshine
Setup your database

Before we can run the website, we need to create a database.

tedb illinois_sunshine

Then, we run the etl.py script to download our data from the IL State Board of Elections and load it into the database.

on etl.py --download --load_data --recreate_views

This command will take between 15-45 min depending on your internet connection.

You can run etl.py again to get the latest data from the IL State Board of Elections. It is updated daily. Other useful flags are:

ownload               Downloading fresh data
ache                  Cache downloaded files to S3
oad_data              Load data into database
ecreate_views         Recreate database views
hunk_size CHUNK_SIZE  Adjust the size of each insert when loading data
Running Illinois Sunshine
clone git@github.com:datamade/illinois-sunshine.git
llinois-sunshine

 run locally
on runserver.py

navigate to http://localhost:5000/

Optionally configure PostgreSQL stop words

While developing this, we noticed that PostgreSQL treats some names od individuals and organizations as stop words. We added a custom stop word list to the repo that can be used to make sure that these names will show up in search results.

 ln -s /path/to/this/repo/sunshine.stop /usr/share/postgresql/9.4/tsearch_data/sunshine.stop

You'll then need to change the STOP_WORD_LIST configuration in app_config.py to sunshine

Team
Errors / Bugs

If something is not behaving intuitively, it is a bug, and should be reported. Report it here: https://github.com/datamade/illinois-sunshine/issues

Note on Patches/Pull Requests
Copyright

Copyright (c) 2015 DataMade and Illinois Campaign for Political Reform. Released under the MIT License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.