LIVES-data Health Score Adapters
Publish your local restaurant health scores.
In a nutshell: each agency which inspects restaurants can have an
"adapter" which is a Ruby class. Its adapter converts its source format into a
simple, standard one. Anybody can then use these adapters to get the data and
work with it how they like. Eaternet,
in particular, will use the production-ready adapters to pull and publish the
information daily on our website.
Available Adapters
Area | Agency | Ruby Class | Notes |
---|
Austin, TX | City of Austin | Austin | |
Las Vegas | Southern Nevada Health District | Snhd | Needs refactoring and docs |
New York City | City of New York Health Department | Nyc | Dataset wiki page |
Portland, OR, USA | Multnomah Couty Environmental Health | Multco | Deprecated. Needs to be updated to use the Accela API |
San Francisco | City of San Francisco | Sf | Needs docs |
Usage
Example: print the names of all New York City restaurants.
require 'eaternet'
nyc = Eaternet::Nyc.new
nyc.businesses.each { |biz| puts biz.name }
Each adapter provides a small set of enumerators such as businesses
and inspections
. See the Las Vegas tests to learn how an application would use this gem. The framework also includes standardized data transfer objects which these enumerators return.
Logging
- Optionally set
EATERNET_LOG_FILE
to send to a file instead of STDOUT
. - Optionally set
EATERNET_LOG_SEVERITY
to an integer to control which
messages are reported. Through experimenting with Logger::
, I've found that
DEBUG
is 0
, INFO
is 1
, WARN
is 2, ERROR
is 3, and FATAL
is 4
.
Installation
Add this line to your application's Gemfile:
gem 'eaternet'
And then execute:
$ bundle
Or install it yourself as:
$ gem install eaternet
Roadmap
See the eaternet/adapters repo
for the project roadmap.
Contributing
Write an adapter for your city's restaurant health scores! Or do a small
refactor or add documentation. We're happy to get the help; submit a GitHub
Issue to start a conversation.
To add your local health scores, you just need to create a class which
include
's AbstractAdapter
. We like good tests, as well. Submit a pull
requests to start a conversation, and we'll work with you.
Once a new adapter is production-ready, we'll plug it into the Eaternet
system, and your adapter will be put into daily production. We're working with
several organizations to publish the information. Yelp was the first to work
with us, and we have new partnerships in the works which we'll announce soon.