Giter Site home page Giter Site logo

adeolapure / illinois-sunshine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andreas-koukorinis/illinois-sunshine

0.0 2.0 0.0 1.2 MB

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

Home Page: http://illinoissunshine.org/

License: MIT License

Python 37.74% CSS 3.81% JavaScript 5.22% HTML 53.23%

illinois-sunshine's Introduction

Illinois Sunshine

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

Setup

Install OS level dependencies:

  • Python 3.4
  • PostgreSQL 9.4 +

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,

mkvirtualenv illinois-sunshine
git clone https://github.com/datamade/illinois-sunshine.git
cd illinois-sunshine
pip install -r requirements.txt
cp sunshine/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,

workon illinois-sunshine

Setup your database

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

createdb 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.

python 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:

 --download               Downloading fresh data
 --cache                  Cache downloaded files to S3
 --load_data              Load data into database
 --recreate_views         Recreate database views
 --chunk_size CHUNK_SIZE  Adjust the size of each insert when loading data

Running Illinois Sunshine

git clone [email protected]:datamade/illinois-sunshine.git
cd illinois-sunshine

# to run locally
python 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.

  • Create a symbolic link from the stop words list in this repo to the PostgreSQL shared directory (this example will work on Debian and Ubuntu):
sudo 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

  • Eric van Zanten - developer
  • Derek Eder - developer

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

  • Fork the project.
  • Make your feature addition or bug fix.
  • Commit, do not mess with rakefile, version, or history.
  • Send a pull request. Bonus points for topic branches.

Copyright

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

illinois-sunshine's People

Contributors

derekeder avatar fgregg avatar renemarcelo avatar evz avatar

Watchers

James Cloos avatar Anjali Deolapure avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.