wrap the Sacramento Open Data API (junar)
npm install scramscram: sacramento county retriever and munger
wrapping the Sacramento County Open Data api

Use:
- $ npm install scram
- visit http://data.saccounty.net/developers/ and obtain an API key
``js
var scram = import(scram)
scram.apiKey = '21235avalidapikey142' //note the quotes
//scram.resouce = 'datastreams' // the default value, but change it...
// a stream of guids
scram.available()
//stream info to stdout by default, or pass custom callback as last arg
scram.info(guid)
// stream 3 results from data to stdout by default, or pass custom callback as last arg
scram.data(guid, 3)
`
The API provides several types of resources (datastreams, datasets,
visualizations, and dashboards). By default, the only looks at datastreams.
This can be changed by modifying the RESOURCES variable in .env.
The module provides three functions:
- available() :
stream the guids available in datastreams to process.stdout
- info(guid, infoProcessor):
print info about a guid (or process with a custom callback function
infoProcessor)
- data(guid, limit=50, streamProcessor):
stream data from guid to process.stdout (or process with a custom
callback function streamProcessor)
The module also provides a wrapper for command-line interaction, scram-cli.
It's set up to populate api key and default resource from a .env file.
- npm install scram and npm link scram, which will put scram-cli in your`
path (and install scram globally)
- copy or simlink bin/.env to the working directory where you
will use the scriptsh`
$ ln -s $(npm prefix -g)/lib/node_modules/scram/bin/.env .
- open .env and edit the line below so after the = is the API key
obtained from http://data.saccounty.net/developers/. Note no quotes here.
`sh`
SAC_API_KEY=21235avalidapikey142
Print help,
`sh`
$ scram-cli -h.env
List all GUIDs in the current resource (defined in ),`sh`
$ scram-cli
Query info (metadata) on a GUID
`sh`
$ scram-cli info GUID
Stream data from a GUID
`sh`
$ scram-cli data GUID
)
- Commit your changes (git commit -am 'Add some feature')
- Push the branch (git push origin -u my-new-feature`)