No release in over 3 years
Low commit activity in last 3 years
A Ruby wrapper for the coronavirus API at https://github.com/ExpDev07/coronavirus-tracker-api
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.16, ~> 1.16
>= 0.13.1, ~> 0.13.1
~> 12.3, >= 12.3.3
>= 3.9.0, ~> 3.9
>= 5.1.0, ~> 5.1
~> 3.8, >= 3.8.3
 Project Readme

Covid19Data-Ruby

Gem Version Gem semver build

A Ruby wrapper for the Coronavirus Tracker API, which by default takes data directly from the Coronavirus (nCoV) Data Repository, provided by Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE). An alternative data source can be specified and will instead pull from the U.S. County data that comes from the Conference of State Bank Supervisors. The New York Times has also been added as an additional source.

Rubygems Page

https://rubygems.org/gems/covid19_data_ruby

Installation

Add this line to your application's Gemfile:

gem 'covid19_data_ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install covid19_data_ruby

Usage

Get an array of the latest data sources, which you can later pass in as an optional named argument to all the other class methods:

Covid19Data.get_sources
=> {"sources"=>["jhu", "csbs", "nyt"]}

By default, the source for each of the following methods is set to 'jhu'. If you want to use a different source, pass it in to any method as an argument: source: 'csbs'.

Get the latest amount of total confirmed cases, deaths, and recoveries globally:

Covid19Data.get_latest
# optional source argument to use csbs
Covid19Data.get_latest(source: 'csbs')

Get case data for all locations with reported cases:

Covid19Data.get_all_locations

Find case data by country code with an optional argument to include timelines:

Covid19Data.find_by_country_code('US', with_timelines: true)

Find case data by location:

Covid19Data.find_by_location(id)

License

The gem is available as open source under the terms of the MIT License.

Changelog

View the changelog for details about the latest release.