Overview
THIS IS INCOMPLETE. I AM STILL WORKING ON IT
LICENSE
GovSDK is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
GovSDK is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GovSDK. If not, see <http://www.gnu.org/licenses/>.
INTRODUCTION
There are numerous ‘government’ APIs from various organizations. This SDK is a model for accessing all of them in a simple and consistent way. I will try to insulate users of this library from changes that might happen in one SDK or another, and where information is available from different sources, pick the source that seems to be the most authoritative at the time. The idea is that by using this API, the developer can stay blissfully unaware of the underlying APIs, as they evolve and change.
KEY IDEAS
API Keys
Unfortunately for now, each of the different services request that you use it’s own API key to get permission to access them. So right off the bat, there’s a way that the abstraction will leak. It can’t be helped, the user of this library will have to acquire API keys for the relevant services and supply them.
IDs
There are various IDs (identifiers assigned by some outside, real world agency to some outside real world thing) throughout the government. One you know is a drivers license number assigned to a person.
Basic usage
Here is a very simplistic minimal example:
</p>
<ol>
<li>You always have to start off by declaring that you want to use Govsdk. You need to supply one or more of your <span class="caps">API</span> keys.
GovSdk.init :sunlight =>
KEY CLASSES
- CongressPerson – Work with legislators: senators and congressmen
- self.find_by_name – return an array of CongressPersons
- self.find_by_zipcode – return an array of CongressPersons
- self.find_by_crp_id – return the CongressPerson with specified crp id
Internal classes
- APIMgr – Parent class of each of the manager classes below
- NewYorkTimesAPI – Class managing access to the New York Times API
- SunlightAPI – Class managing access to the Sunlight API
- SpenSecretsAPI – Class managing the OpenSecrets API
- Methods: setAPIKey/getAPIKey
Utils
There are lots of simple transformations which come up in using these APIs and so for convenience sake some of those are built right into this library
Utils.lookup_state_name(string) → two letter state code for that state