Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

weatherb

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weatherb

  • 0.1.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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')

# Return a observational data at the present time
realtime = weatherb.realtime(lat: 40.784449, lon: -73.965208)

# Return a forecast data on a minute-by-minute basis
nowcast = weatherb.nowcast(lat: 40.784449, lon: -73.965208)

# Return a forecast data on an hourly basis
hourly = weatherb.hourly(lat: 40.784449, lon: -73.965208)

# Return a forecast data on  a daily basis
daily = weatherb.daily(lat: 40.784449, lon: -73.965208)

The example above uses the default values, you can also add some additional parameters.

# You can change the unit system into Royal (us), the default is Metric (si)
us_realtime = weatherb.realtime(lat: 40.784449, lon: -73.965208, unit_system: 'us')

# You can also specify the return field(s)
temp__humidity_hourly = weatherb.hourly(lat: 40.784449, lon: -73.965208, fields: ['temp', 'humidity'])

# And timestep for nowcast
ten_minutes_nowcast =  weatherb.nowcast(lat: 40.784449, lon: -73.965208, timestep: 10)

# Also start time and end time for nowcast, hourly, and daily API
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.

FAQs

Package last updated on 18 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc