This is a temporary repository of scrapers written using Billy to collect legislative information from local governments in the United States.
To get started, you may re-use Open 13's excellent instructions, replacing open13
where appropriate. Briefly, if you already have Git, MongoDB, Python 2.7 and virtualenvwrapper 1.7 or greater, then fork this repository and run:
git clone https://github.com/YOURUSERNAME/opengovernment-local.git
cd opengovernment-local
mkvirtualenv oglocal --system-site-packages
If you are not using the boundary service described below, comment out the following line in requirements.txt
:
-e git+http://github.com/rhymeswithcycle/represent-boundaries.git#egg=represent-boundaries
Run pip install -r requirements.txt
and you should be ready to go!
You do not need a boundary service to run the scrapers. GeoDjango is not compatible with PostGIS 2.0, so you must use PostGIS 1.5. PostGIS 1.5 is not compatible with PostgreSQL 9.2, so you must use PostgreSQL 9.0. On OS X, if you already have PostgreSQL 9.2 via Homebrew, run:
brew tap homebrew/versions
brew unlink postgis
brew install postgis15
initdb /usr/local/var/postgres9
cp /usr/local/Cellar/postgresql9/9.0.8/org.postgresql.postgres.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
Then you can run:
createdb -h localhost oglocal
psql oglocal -f /path/to/postgis.sql
psql oglocal -f /path/to/spatial_ref_sys.sql
cp local_settings.py.example local_settings.py
Then, edit local_settings.py
with your PostgreSQL credentials and run:
python site/manage.py syncdb
python site/manage.py loadshapefiles
The repository for OpenStates' shapefiles is sunlightlabs/pentagon.
billy-update pa-philadelphia --fastmode
billy-update ca-san-jose --fastmode
For now, see the OpenStates documentation.
python site/manage.py runserver
- Browse the web version at http://127.0.0.1:8000/
- Consult the scraper dashboard at http://127.0.0.1:8000/admin/
- Use the API according to the OpenStates documentation
This project's main repository is on GitHub: http://github.com/opengovernment/opengovernment-local, where your contributions, forks, bug reports, feature requests, and feedback are greatly welcomed.
Copyright (c) 2012 Participatory Politics Foundation, released under the MIT license