I’ve spent a few days during work, after work and on the weekend working on python-sunlight, a unified API implementation of a few Sunlight services.
This is very unstable, and not released yet (so please don’t rely on it yet), but it will be shortly.
Be sure to sign up for an API Key, and dump the key to ~/.sunlight.key — there’s a simple script to help with some of this in bin/, but nothing solid yet.
I do, however, encourage you to use it and play around with it, and report your bugs.
Contributions (in the form of code) are also very welcome, so please do fork the project and play around with it.
Just to give everyone a taste of how cool this is — this will pull up a list of twitter IDs of people who mention “free market” more then anyone else according to the congressional record:
from sunlight import capitolwords
from sunlight import congress
for person in capitolwords.phrases_by_entity(
"legislator",
phrase="free market",
sort="count",
):
n = congress.legislators( bioguide_id=person['legislator'],
all_legislators="true" )
if len(n) >= 1:
n = n[0]
if n['twitter_id'] != "":
print n['twitter_id']
And the output:
RepRonPaul
stevekingia
SenSherrodBrown
JacksonLeeTX18
SenatorLeahy
ChuckGrassley
SenJohnMcCain
OrrinHatch
DanaRohrabacher
JudgeTedPoe
McConnellPress
edtowns
SenatorDurbin
SenatorSessions
SenatorHarkin
SenChrisDodd
russfeingold
RosLehtinen
sencarllevin
senjonkyl
Dennis_Kucinich
senatorsanders
SenatorReid
RepDanBurton
RepMikePence
SenSamBrownback
joebiden
FrankPallone
ToddAkin
senatorboxer
RepTrentFranks
JohnCornyn
Have fun!
Show off what’cha got, and please let me know if you do something cool!

npr’s site is using some OpenStates data, the project I’m currently working on at sunlight labs.
If you feel like affecting change in US politics, and know Python, we could use some help (it’s a F/OSS project!) over on github
Keep being awesome!
I’ve whipped up two libs this week, and both have some pretty radical uses. The fist is python-charlie, which can be found on github, which is named in honor of Charlie on the MTA.
This lib will fetch data on the Boston MBTA T (rather, just the Red, Orange and Blue lines), which can actually be super useful in a lot of ways.
I’d love to see some hacks with this data!
The second is php-openstates, a PHP binding into the openstates API. It comes with a nifty little util to get some bill listings, but hopefully, this will mature as teh project grows.
Fork the project on github. Rock on.
As of today, I’ve left my current job at Boston College for a new spot at The Sunlight Foundation, a government transparency nonprofit.
Needless to say, all opinions from here on out are my own, and in no way represent anyone other them myself. Sometimes, not even myself.
Anywyo, I’m very exited, and going to be working on Open States, a F/OSS backed API into state government data.
Can’t wait!
Design by Simon Fletcher. Powered by Tumblr.
© Copyright 2010