Fully Implements the SchoolDigger API in Ruby
Add this line to your application's Gemfile:
gem 'school_digger'
And then execute:
$ bundle
Or install it yourself as:
$ gem install school_digger
Be sure to define your SchoolDigger credentials by setting up environment variables in your application appropriately. Refer to the .env.sample file for details.
SCHOOL_DIGGER_APP_ID = 'my-id'
SCHOOL_DIGGER_APP_KEY = 'my-key'
There are 7 primary APIs that are wrapped. Below you will see basic examples of how to use them. For more information about what optional query parameters are available, please consult the SchoolDigger API Docs
SchoolDigger::Api.new.autocomplete('San Die', st: "CA")
SchoolDigger::Api.new.districts('CA')
SchoolDigger::Api.new.schools('CA', q: "Los Angeles")
SchoolDigger::Api.new.district("0600001")
SchoolDigger::Api.new.district_rankings('CA')
SchoolDigger::Api.new.schools('CA')
SchoolDigger::Api.new.schools('CA', q: "East High")
SchoolDigger::Api.new.school("490003601072")
SchoolDigger::Api.new.school_rankings('CA')
There is a built in next_page
method that will fetch the next page of results for any response
response = SchoolDigger::Api.new.districts('CA')
next_page_response = SchoolDigger::Api.new.next_page(response)
It is able to be used with any api here that supports standard paginate
Implemented APIs from SchoolDigger API Docs
(Last updated on February 28, 2019)
API | Description | Implemented? |
---|---|---|
Autocomplete | Returns a simple and quick list of schools for use in a client-typed autocomplete | π |
Search Districts | Returns a list of districts | π |
Find District | Returns a detailed record for one district | π |
Search Schools | Returns a list of schools | π |
Find School | Returns a detailed record for one school | π |
School Rankings | Returns a SchoolDigger School Rankings list | π |
District Rankings | Returns a SchoolDigger School Rankings list | π |
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/beneggett/school_digger. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the SchoolDigger projectβs codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.