Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md Update README.md Jul 3, 2013
open311SNSL.py Updated Open311 Service categories Dec 19, 2013



Open311 is a form of technology that provides open channels of communication for issues that concern public space and public services. Primarily, Open311 refers to a standardized protocol for location-based collaborative issue-tracking. Open311 provides access to Services, Facilities, and Frequently Asked Questions (FAQs). Open311 also provides the 311 Today feed which provides daily status messages regarding Public Schools, Alternate Side Parking, and Garbage/Recycling pick up. Important City announcements based on current events may also be provided through this feed.

Import The Library

To use the included Python Library, you must first import it:
import open311SNSL

If the library fails to import, make sure python is set to search the directory that the file is located in. Then restart python and try again.

Creating ServiceList Object

Creating a open311 ServiceList object and setting the API Key/ID:
ServListObj = open311SNSL.servicelist('API ID' , 'API Key')

Changing the API Key or ID for a servicelist object that was already created:

Getting the API Key or ID for a DOT object that was already created:

Using an already created object, search for "all" service lists and format as a JSON or XML
serviceListOutput = ServListObj.getServiceList(ServListObj.s_all , ServListObj.json)
serviceListOutputServListObj.getServiceList(ServListObj.s_all , ServListObj.xml)

To output the result in text format:
print serviceListOutput.text

Creating an open311 Service Object:

Creating a open311 Servic object and setting the API Key/ID and Service ID:
serviceObject = open311SNSL.service('API ID' , 'API Key' , 'service_id')
Get specific service information and output as a JSON or XML
serviceInfo = serviceObject.getService(serviceObject.xml)
serviceInfo = serviceObject.getService(serviceObject.json)

To output the result in text format:
print serviceInfo.text

For further documentation and examples, see the integrated help Doc in python: