Skip to content
Go to file
This branch is 8 commits ahead, 7 commits behind codeforamerica:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Councilmatic! Build Status

City Council Legislative Subscription Service.

Contact Us

Getting Started

IMPORTANT: If you are interested in setting up Councilmatic for your city, you'll want to start with a sample local instance. In most cases, this is the right place to start. If instead you are interested in making modification to the core of Councilmatic, proceed with these instructions.


First check out the project code.

$ git clone git://

To work on your own instance of Councilmatic, you should first get Python installed. Follow the instructions for doing so on your platform. For example, Mac OS X Mountain Lion 10.8.

We recommend setting up a virtual environment for working with any project, so that you can manage your project-specific dependencies. This is optional but recommended:

virtualenv env --no-site-packages
source env/bin/activate

Next, install the requirements for Councilmatic (we recommend working in a virtual environment, but it's not strictly necessary).

$ pip install -r requirements.txt

This file might not fully finish installing; if you get a hang-up on pdfminer, try installing it manually then re-run pip install -r requirements.txt.

Be sure to also install the scraper library for your city's legislative management system. For cities using Granicus's latest version of Legistar, this will be @fgregg's

Non-Python requirements include:

  • pdftotext and pdftohtml (use apt-get install poppler-utils on Ubuntu)

Legislation source

Copy the file local-councilmatic-sample/ to local-councilmatic-sample/ Fill in the LEGISLATION setting in this file. By default, it is set up to scrape from Philadelphia's legislation system.

For example:

    'SYSTEM': 'Granicus Legistar',
    'ROOT': '',
    'ADDRESS_BOUNDS': [37.82714,-84.70459, 38.20797,-84.25964], # lat, lng, lat, lng
    'ADDRESS_SUFFIX': ', Lexington, KY',

    'SCRAPER': (''
        'hostname': '',
        'fulltext': True,        # Load and store full text from PDFs?
        'sponsor_links': False,  # Are sponsor names in anchors/links?

        # Label overrides
        # ---------------
        'id_label': 'File #',
        'controlling_body_label': 'In control',
        'intro_date_label': 'File Created',
        'topics_label': 'Indexes',


Create a database for Councilmatic. Typically this is done like:

createdb -T template_postgis councilmatic

where template_postgis is the name of your PostGIS database template. If you do not yet have one, you can find instructions for getting your system ready for Django and PostGIS online. For example, here are instructions for Mac, and Ubuntu. For other platforms, and for further instructions, the GeoDjango docs are a good place to look.

NOTE that PostGIS 2.0 is not compatible with Django 1.4. As Councilmatic is currently not set up to run on Django 1.5, you should install PostGIS 1.5

Set up the project database and populate it with city council data (when the syncdb command prompts you to create an administrative user, go ahead and do so). There is a lot of data to be loaded, so downloading it all may take a while.

cd local-councilmatic-sample
mkdir ../logs
createuser -s -r postgres # Create the postgres role in PostgreSQL
python syncdb # Create admin account when prompted.
python migrate
python loadlegfiles # For first-time installs.
python updatelegfiles
python rebuild_index # For searches. Say yes when prompted.
python collectstatic # For js and css. Say yes when prompted.

For example, loading the database for the first time:

(env)code/councilmatic/local-councilmatic-sample at owne-pc (master ✔)% python loadlegfiles
No local copy of database exists.
Downloading the database (~40M -- this may take a while)...

Development server

Finally, to run the server:

$ python runserver

Now, check that everything is working by browsing to http://localhost:8000/. Now browse to http://localhost:8000/admin and enter the admin username and password you supplied and you should have access to all of the legislative files!


The core of Councilmatic is implemented as a Django app. It cannot be run without a Django project. The local-councilmatic-sample folder contains a minimal Django project.


Copyright (c) 2010 Code for America Laboratories See LICENSE for details.

Code for America Tracker


A City Council Legislative Information Subscription Service



No releases published
You can’t perform that action at this time.