Django Cal-Access Lobbying Activity

django-calacces-lobbying-activity is a simple Django app to lobbying activity data from the cal access database. It is reliant on django-calaccess-parser.

Detailed documentation is in the “docs” directory. (coming soon)



  • Install django-calaccess-browser with pip

    $ pip install django-calaccess-lobbying-activity
  • Add lobbying to your INSTALLED_APPS setting like this:


    In your project

    urlpatterns = patterns('',
        url(r'^browser/', include('lobbying.urls')),
  • Next, sync the database, create a Django admin user, and run the management command to extract campaign finance data from from the raw calaccess data dump.

    $ python syncdb
    $ python build_lobbying
    warning:This’ll take a while. Go grab some coffee or do something

    else productive with your life.


The JavaScript and CSS for the project is managed with Grunt and Bower. Currently, the JavaScript and SCSS dependencies are not included so you’ll need to build them yourself;

  1. Install Node.js (this will also include NPM)
  2. Install Grunt and bower globally with npm install -g bower grunt-cli
  3. Go to the static directory and install the required dependencies with npm install && bower install
  4. Generate the main.css file and watch for HTML, CSS and JavaScript changes by executing grunt

Explore data

Start the development server and visit to inspect the Cal-access data.


django-calaccess-browser uses django-tastypie to expose the data as an API. Add tastypie to the project INSTALLED_APPS and make sure you included lobbying.urls in your project’s

From there visit to explore the JSON representation of the data.


You can also export the data into easily queryable flat files.

$ python export_lobbying

Update the data

When you are ready to get new data, just blow away both the parser and the campaign finance browser app. Then reload them.

You can do something like this, making sure you fill in your database and user names correctly. bash  $ python sqlclear calaccess | mysql -u user_name -p database_name  $ python sqlclear lobbying | mysql -u user_name -p database_name  $ pytnon syncdb  $ python downloadcalaccess && python build_lobbying