By definition CiviCRM is used by many organizations in the political sphere. For those organizations working in the US one useful metric to have on your contacts is their congressional district. Up until now this has usually been accomplished with either custom code, or exporting your contacts, sending them through a bulk lookup tool, and re-importing them. There is now an easier way to get this with the CiviCRM Sunlight Congressional District module. Yes the name is long but verbosity is perhaps better than obscurity when naming your open source project* (Login Toboggan and Deadwood I’m looking at you).
As the name implies this module integrates with the excellent Sunlight API. The Sunlight API is a way for developers to easily fetch information about congressional districts and the members of congress that represent them. With this module you can now integrate this into CiviCRM with ease:
- Enable the module
- Create some custom fields in CiviCRM to store the congressional district
- Tell the module about your fields
- Watch as the module fetches information from Sunlight
The module also exposes its own API so that you can go even further to fit your site’s needs (list all users in a district, show the members of congress for a district, etc. ). As an example of how to utilize this API it includes an additional module called “Congress” that provides a user tab showing the user’s congress members, and a directory of all your user’s districts.
The module is currently in Beta. There’s some polishing that needs to be done to make the module useful in a wide variety of use cases. But don’t let that hold you back. The module is used in production on at least one major site and has already done several hundred thousand lookups.
* The downside to such a long name is that through the rest of this blog post I need to refer to it as “the module” 😛
This has been cross-posted to civicrm.org