Fwd: Python API

4 views
Skip to first unread message

Ian Bicking

unread,
Jun 23, 2009, 4:20:57 PM6/23/09
to OCTO...@googlegroups.com
Hi all.  I am thinking about making a Python API for the DC 311 system, mostly as a learning tool so I can get my head around the data that is being provided.  Has anyone worked on anything with Python specifically?  Is there any preference about where I host the work (mostly to make it easy for other people to find and contribute to later)?

It might be fun to then take something like http://shell.appspot.com/ and set up a shell accessible over the web that has the library setup and instantiated, as a kind of API browser.

Luigi Montanez

unread,
Jun 23, 2009, 4:28:26 PM6/23/09
to OCTO...@googlegroups.com
I assume you mean a Python wrapper for the API. Have a look at the Sunlight API wrapper:

http://github.com/sunlightlabs/python-sunlightapi/tree/master

Because the DC 311 API is structured off the Sunlight API, the python-sunlightapi wrapper would be a great starting point for you.

You'll definitely want to host the code on GitHub -- the ability to fork makes it a natural for further contributions from the community.

Best of luck,
Luigi

Dmitry Kachaev (OCTO)

unread,
Jun 23, 2009, 4:28:32 PM6/23/09
to OCTO...@googlegroups.com
Well, our API is built on Python internally. Will be great to see what you will build.

Also we should release new version of API with cleaned up JSON and some other improvement (hopefully tonight), but it can be modification of current version so changes should be simple.

No preferences on source hosting from our side. We are planning to clean up our code and release it publicly sometime soon.

-Dmitry

Dmitry Kachaev, Director of R&D
Office of the CTO, DC Government

voice: (202) 527-9423
mail: dmitry....@dc.gov
location: One Judiciary Square, 1010S
schedule: http://links.dc.gov/dk-freebusy


On Tue, Jun 23, 2009 at 4:20 PM, Ian Bicking <ia...@openplans.org> wrote:

Ian Bicking

unread,
Jun 23, 2009, 8:50:00 PM6/23/09
to OCTO...@googlegroups.com
The code is up here: http://github.com/ianb/python-dc311/

I have most of it mapped I think.  I think the service requests have a typo with servicetypeocode instead of servicetypecode.  Dmitry mentioned JSON cleanup, which I'm assuming means flattening those lists of one-item dicts/objects?  Converting the "NULL" strings might also be nice.

The doctest more or less shows how it is used:
Where does the area ID come from?

Dmitry Kachaev (OCTO)

unread,
Jun 23, 2009, 9:40:50 PM6/23/09
to OCTO...@googlegroups.com
Great,
I will put it on api.dc.gov page.

-Dmitry

Dmitry Kachaev, Director of R&D
Office of the CTO, DC Government

voice: (202) 527-9423
mail: dmitry....@dc.gov
location: One Judiciary Square, 1010S
schedule: http://links.dc.gov/dk-freebusy



Reply all
Reply to author
Forward
0 new messages