Giter Club home page Giter Club logo

coviddata's Introduction

CovidData

About | CSVs | API | Visualization | Repo

CovidData provides statistics about COVID-19:

  • Daily cases, deaths, and recoveries by country, region, and city
  • Cumulative daily counts and incremental daily counts
  • CSV and JSON formats
  • Frequent data updates for both formats (CSV and JSON)

Table of Contents

About

Methodology

This project's purpose is to provide frequently-updated COVID-19 datasets with global data in stable, easily-consumed formats.

The project reads data from multiple data sources, performs normalization and aggregations on top of it, and exposes the results as CSVs and JSON.

Here's a summary of its logic:

  1. Read data from the data sources
  2. Normalize location names (e.g., "Iran (Islamic Republic of)" => "Iran")
  3. Generate cumulative counts per country and per region by grouping by the normalized location names and summing the data
  4. Generate derived data (e.g., incremental daily counts) based on the cumulative data
  5. Write the resulting data to CSVs and JSON files

All of this logic can be viewed within the project's repo. The logic is in the src directory, and the update scheduling is in the .github/workflows directory.

Definitions

  • Region - A state, province, or similar area
  • Place - A city, town, county, or similar area

Data Sources

Data Updates

The data is updated from the data sources multiple times per day. The data update frequency is the same for both the CSVs and JSON. The update schedule can be found in cron format in update_data.yml.

CSVs

Data Description Sample
countries/cases.csv Cumulative cases by country and date. Sample
countries/deaths.csv Cumulative deaths by country and date. Sample
countries/recoveries.csv Cumulative recoveries by country and date. Sample
regions/cases.csv Cumulative cases by region and date. Sample
regions/deaths.csv Cumulative deaths by region and date. Sample
regions/recoveries.csv Cumulative recoveries by region and date. Sample
places/cases.csv Cumulative cases by place and date. Sample
places/deaths.csv Cumulative deaths by place and date. Sample
places/recoveries.csv Cumulative recoveries by place and date. Sample

API

The API provides statistics about cases, deaths, and recoveries by country, region, and place.

Usage

For example, to print the number of cases per day in China using JavaScript on a website:

fetch("https://coviddata.github.io/coviddata/v1/countries/stats.json")
  .then(response => response.json())
  .then(data => {
    const country = data.find(country => country.country.name == "China");
    for (date in country.dates) {
      console.log(`${date} - ${country.dates[date].cumulative.cases} cases`);
    }
  })

Countries

New and cumulative cases, deaths, and recoveries by country and date.

Example response:

[
  {
    "country": {
      "key": "china",
      "name": "China"
    },
    "dates": {
      "2020-01-25": {
        "new": {
          "cases": 483,
          "deaths": 16,
          "recoveries": 3
        },
        "cumulative": {
          "cases": 1399,
          "deaths": 42,
          "recoveries": 39
        }
      },
      "2020-01-26": {
        "new": {
          "cases": 663,
          "deaths": 14,
          "recoveries": 10
        },
        "cumulative": {
          "cases": 2062,
          "deaths": 56,
          "recoveries": 49
        }
      }
    }
  }
]

Regions

New and cumulative cases, deaths, and recoveries by region and date.

Example response:

[
  {
    "region": {
      "key": "hubei-china",
      "name": "Hubei",
      "full_name": "Hubei, China",
      "country": {
        "key": "china",
        "name": "China"
      }
    },
    "dates": {
      "2020-01-25": {
        "new": {
          "cases": 212,
          "deaths": 16,
          "recoveries": 1
        },
        "cumulative": {
          "cases": 761,
          "deaths": 40,
          "recoveries": 32
        }
      },
      "2020-01-26": {
        "new": {
          "cases": 297,
          "deaths": 12,
          "recoveries": 10
        },
        "cumulative": {
          "cases": 1058,
          "deaths": 52,
          "recoveries": 42
        }
      }
    }
  }
]

Places

New and cumulative cases, deaths, and recoveries by place and date.

Example response:

[
  {
    "place": {
      "key": "new-york-city-new-york-united-states",
      "name": "New York City",
      "full_name": "New York City, New York, United States",
      "country": {
        "key": "united-states",
        "name": "United States"
      },
      "region": {
        "key": "new-york-united-states",
        "name": "New York",
        "full_name": "New York, United States",
        "country": {
          "key": "united-states",
          "name": "United States"
        }
      }
    },
    "dates": {
      "2020-03-23": {
        "new": {
          "cases": 2651,
          "deaths": 36,
          "recoveries": 0
        },
        "cumulative": {
          "cases": 12305,
          "deaths": 99,
          "recoveries": 0
        }
      },
      "2020-03-24": {
        "new": {
          "cases": 2599,
          "deaths": 32,
          "recoveries": 0
        },
        "cumulative": {
          "cases": 14904,
          "deaths": 131,
          "recoveries": 0
        }
      }
    }
  }
]

coviddata's People

Contributors

actions-user avatar bfosten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

coviddata's Issues

Data United States

Today data of United States are missing....cumulative case and death are a 0

Places data showing 4/6/20 as the last data.

Thank you very much for putting this together for use. The Places data is showing 4/6/20 as the last data collected, but file shows an update was done 15 hours ago as of 4/8/20 9:37am (mountain time). I usually download this data once a day and it often shows just 1 day behind. Wondering on the places data set. Please help.

In search of COVID-19 daily testing data (exportable)

Good afternoon,

I am actively searching for data related to testing of COVID-19. I have found a few links, but curious to know if there is a particular resource that provides this data in a form that can easily be exported to excel files.

I am particularly interested in seeing how the number of positive COVID-19 cases vary with testing i.e. are we seeing more cases when we test more? How do these numbers vary by location and do we have any resources that provide this very information as gathered both within the US and globally?

Any help guidance you can offer will be greatly appreciated.

docs: methodology

Great stuff! I wish I could use it for my dashboard Pandemic Estimator but for that your API lacks documentation on methodology. I'm using JHU directly and I know what chaos it is, the most blatant example being that they provide "cumulative data" that's not cumulative quite often in practice. And the whole change of file formats, etc.

Can you please describe methodology how you deal with it? What has been omitted, what has been "adjusted" and how? Thank you!

Add FIPS code to the Stats

For mapping, this seems to be an essential feature. How hard would it be to patch in a FIPS code. Seems like it would be really helpful if users of this API didn't have to figure out a way to map Place + Region + Country -> FIPS Code on their own. Even if this worked only for the United States, I think it would be a big value add. Thoughts?

NY Times data lags JHU data

It seems NY Times is a day or two behind JHU.

One option to maintain up to date State level date would be to freeze the time series state data as is and append data for each new day from the 'live' JHU data (updated hourly).

deaths.csv is missing the date 2020-03-13

Data for March 13 is missing from the deaths.csv file. (BTW, thanks so much for putting this data together. I was struggling with where to get the U.S. daily region data from after the main site changed their format.)

Fully relationally normalized DB

Hi, this project looks great! I was wondering if you would also consider supplying a fully relationally normalized DB for easy importing into SQL databases for easy querying. I was thinking something like the following schema:

A places table with the following fields:

id,country,region,city,lat,lon

A reports table with the following fields:

place_id,date,confirmed,deaths,recovered

More fields could be added to this table if more data becomes available. Ideally I think it would be really useful to have

place_id,date,tested,confirmed,hospitalized,icu,deaths,recovered

...but alas, I haven't seen anyone reporting this level of granularity.

If this data was compiled as two CSV files and checked into a git repository somewhere, then we would also have a nice record of changes to any of this data over time.

Last run...

FYI, in the last update USA is shown wrong figures..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.