Weatherb
Weatherb comes from weather + rb (ruby file extension). It's basically a Ruby gem for retrieving data about weather using the ClimaCell API in a simple way.
Installation
Add this line to your application's Gemfile:
gem 'weatherb'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install weatherb
Usage
To be able to use this gem, you need a ClimaCell account. Sign in to your ClimaCell account and visit the dashboard, there you'll find your API key.
weatherb = Weatherb::API.new('this-is-your-api-key')
realtime = weatherb.realtime(lat: 40.784449, lon: -73.965208)
nowcast = weatherb.nowcast(lat: 40.784449, lon: -73.965208)
hourly = weatherb.hourly(lat: 40.784449, lon: -73.965208)
daily = weatherb.daily(lat: 40.784449, lon: -73.965208)
The example above uses the default values, you can also add some additional parameters.
us_realtime = weatherb.realtime(lat: 40.784449, lon: -73.965208, unit_system: 'us')
temp__humidity_hourly = weatherb.hourly(lat: 40.784449, lon: -73.965208, fields: ['temp', 'humidity'])
ten_minutes_nowcast = weatherb.nowcast(lat: 40.784449, lon: -73.965208, timestep: 10)
next_time_daily = weatherb.daily(lat: 40.784449, lon: -73.965208, start_time: '2020-06-16T23:59:00', end_time: '2020-06-20T12:00:00')
Find out more about the ClimeCell API in their documentation.
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
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.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/zackijack/weatherb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Weatherb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.