nysenatecio / OpenLeg

Open Legislation Tools for the NY Senate

Home | Edit | New

Home

This project provides access to the source code for the NY Senate Open Legislation service hosted at: http://open.nysenate.gov/legislation

While the source is available through this site, it is not quite ready for public consumption and re-use. Please check back soon for more announcements about our formal source code releases

Summary

The basic concept is to parse the flat file records from the mainframe into some sort of modern relational or object datastore. This datastore can then be queried via a simple RESTful API to produce output in any number of desired formats or standards – XML (RSS, ATOM, custom schemas), JSON, CSV, HTML (widgets).

RESTful API Path Structure

basepath: /api/ {version} / {format} / {command} / {argument}
full output (w/ text and memo fields!):
HTML: /api/1.0/html/bill/{senate or assembly bill id}
JSON: /api/1.0/json/bill/{senate or assembly bill id}
XML: /api/1.0/xml/bill/{senate or assembly bill id}
RSS: XML: /api/1.0/rss/bill/{senate or assembly bill id}
CSV: /api/1.0/csv/bill/{senate or assembly bill id}

Other search paths:
/api/1.0/{format}/committee/{committee name}
/api/1.0/{format}/sponsor/{sponsor last name}
/api/1.0/{format}/search/{free text search of summary, text or memo}

where {format} = xml, json, rss, csv, html

Here a links to the various views of Senate bill S21:
http://open.nysenate.gov/legislation/api/1.0/html/bill/S21
http://open.nysenate.gov/legislation/api/1.0/xml/bill/S21
http://open.nysenate.gov/legislation/api/1.0/json/bill/S21
http://open.nysenate.gov/legislation/api/1.0/csv/bill/S21

Output of bills from the transportation committee:
XML: http://open.nysenate.gov/legislation/api/1.0/xml/committee/transportation
JSON: http://open.nysenate.gov/legislation/api/1.0/json/committee/transportation
RSS: http://open.nysenate.gov/legislation/api/1.0/rss/committee/transportation

RSS of all recent floor actions:
RSS: http://open.nysenate.gov/legislation/feed/

Search Options
There are currently five different distinct paths for searching on Open Legislation:

1) By KEYWORD: type one or more words in the text box at the top of any screen; this performs a keyword search on the Title, Summary, Memo, Bill Number and Sponsor fields of all bills (and resolutions), and any bill containing any of the keywords will be returned. Highest numbered bills are returned first, at the top of the list. TIP: you can also use the “AND” operator or "" (quotation marks) to narrow your keyword search to more precise matches.

2) By RECENT ACTIONS: click the “Recent Actions” hyperlink to return the bills with the most recent activity; you may then further refine this search by using the drop-down menu to filter by various types of recent actions; these filters search for the respective action keywords within the “action” text field.

3) By RECENT VOTES: click the “Recent Votes” hyperlink to return the bills most recently voted upon in the Senate; note that this search will not return Assembly bills.

4) By SPONSOR: click on the “By Sponsor” hyperlink to get a listing of all Senators, from which you can click on any Senator to see a full listing of bills they have sponsored.

5) By COMMITTEE: click on the “By Committee” hyperlink to get a listing of all Senate Standing Committees, from which you can click on any Committee to see a full listing of bills from that Committee; note that this search will not return any Assembly Committees or bills.

Other Useful Links
Developed Mark Headd has used the OpenLeg API to developer a number of mobile applications: http://www.voiceingov.org/blog/?p=1136&cpage=1

License
Open-Source Software & Software Licenses
In order to make the Senate’s information and software as public as possible, it is has adopted unique system using two types of licenses – GNU General Public License as well as the BSD License. This system is meant to ensure the most public licsence is used in each specific case such that:

(i) Any Software released containing components with preexisting GPL copyrights must be released pursuant to a GPL v3 copyright restriction.
(ii) Any Software created independently by the Senate without any preexisting licensing restrictions on any of its components shall be released under dual licensing and take one of two forms: (a) a BSD license, or (b) a GPL v3 license. The ultimate user of such Software shall choose which form of licensing makes the most sense for his or her project.
(iii) Regarding Software containing preexisting copyright restrictions other than GPL, the CIO shall make the determination how he or she wishes to release such Software.

GPL v3: http://www.gnu.org/copyleft/gpl.html
BSD: http://www.opensource.org/licenses/bsd-license.php

Last edited by nathanfreitas, Sat Dec 12 09:31:16 -0800 2009
Home | Edit | New
Versions: