Visualize eGovPDX's CouncilConnect API

by Jesse on July 31, 2011, 11:56 a.m. | tagged: python civic hackathon protovis gov2.0
I concluded my OSCON themed week yesterday at an API Hackday event at the awesome Urban Airship offices in (sunny) downtown Portland, OR. Organizations with APIs "shovel ready for hacking" encouraged developers from Portland and around the country to take a shot at creating something innovative in just several, short hours. The event was really well attended - it's smart to do something like this while OSCON is in town!

I really appreciated the sponsors' efforts to get people involved by using their APIs to provide starting points and generate ideas for hacks. This was not a 24 hour event so things had to get moving quickly. The demos of the Simple Geo, SendGrid and Twilio products were particularly impressive to me. My primary focus these days is on government data and innovative systems that use it well. Happily, the eGovPDX team (Portland's very own, dedicated Gov 2.0 initiative) was a sponsor and challenged the participants to build something cool with their new City Council Connect API. The City Council Connect API makes it easy to query for information about Portland City Council meetings and, perhaps most importantly, the voting records of the Mayor and commissioners who attended those meetings.

After spending some time to familiarize myself with the dataset (with a lot of help from the eGovPDX team), I decided my concept would be "visualizations to aid understanding". The value of data that the City Council API exposes might not always be immediately obvious to every potential user. If done properly, visualizations can help introduce people to imposing mountains of data in fun ways. To create my visualizations, I used Python to pull down the JSON data from the eGovPDX web service, parse it, analyze it with the Natural Language Tool Kit (NLTK) library for Python and then generate HTML output that utilizes the ProtoVis Javascript package. In such a short amount of time, I was only able to complete a Circle Packing of Yes/No/Abstain votes for issues and a Word Bubble of the top 50 terms used in the titles of issues voted on by City Council members in the last year or so.

You can view the demonstration page that I created for the contest portion of the hackathon here. I will post the Python code used to create these HTML pages on Github soon and post the link back here so check back if you are interested. I'm planning to push this forward a little more and use the above tools and eGovPDX API to create a set of visualization widgets that people will be able to use to keep track of issues and voting records from their desktop or blog. If you have any ideas or want to collaborate please let me know!

I have to thank Rick Nixon and his eGovPDX team for awarding me the "Best Portland City Council Hack" - a $300 Apple gift card! Who says you can't make a buck in this open government data game?

Laptop sticker census   CivicVis
photo credit: Andy Lester
blog comments powered by Disqus