Giter Site home page Giter Site logo

covid19's Introduction

COVID-19 DATA API

This package makes COVID-19 data available through python API. All the data are directy taken from the CSSEGISandData-covi19 with the below mentioned data sources. There are several methods to extract the statistics and counts for the coutry or province.

Installation:

Also available in pypi:

covid-data-api

From GitHub:

  • Clone this repo.
  • pip install -r requirements.txt
  • python setup.py install

How to user:

Initialising the instance/api:

from covid.api import CovId19Data

api = CovId19Data(force=False)

If force = True, every time object is instantiated new data is downloaded. Otherwise data will be refreshed after 24 hrs.

Method 1: Get stats:

Get the latest total stats for all confirmed, deaths and recovered till the latest date available.

res = api.get_stats()

Method 2: Get records for all the countries:

res = api.get_all_records_by_country()

Method 3: Get records for all the state/Province:

res = api.get_all_records_by_provinces()

Method 4: Filter by Country:

To find all the countries availabe, plese use show_all_available_countries api.

res = api.filter_by_country("ireland")

Method 5: Filter by Province/State:

To find all the countries availabe, plese use show_all_available_regions api.

res = api.filter_by_province("British Columbia")

Method 6: Show all available Countries:

res = api.show_available_countries()

Method 7: Show all valiable Province/State:

res = api.show_available_regions()

Method 8: Get history data for a given Country:

res = api.get_history_by_country("ireland")

Shows all the country metrics confirmed, recovered and deaths for the dates till the latest date.

Method 9: Get history data for a given State/Province:

res = api.get_history_by_province("British Columbia")

Shows all the state/province metrics confirmed, recovered and deaths for the dates till the latest date.

Data Sources:

All used data sources CSSEGISandData-covi19.

Support and Maintenance:

Please raise an issues with issues of this git repo. This is not actively supported, however anyone with the interest can solve the raised issues.

Copying and License

Terms and conditions of the data provider:

CSSEGISandData-covi19

Terms and Condition of this repo:

License: MIT

Authors:

see also contributors

ChangeLog:

  • 1.1, 1.2, 1.3 - Initial Versions

  • 1.4 - Change in recovered cases in source CoViD data repository.

covid19's People

Contributors

ss-bhat avatar vipin-tech avatar

Stargazers

Devbrat Anuragi avatar Stamatis Tsagkliotis avatar Amritendu Mondal avatar Martin Zürn avatar David Josephs avatar Master Linux avatar

Watchers

James Cloos avatar  avatar

covid19's Issues

data inconsistansy notices

Hi,

Why the death data is not consistent by days.
res = api.get_history_by_country("india")
print(res)

result:
'2020-03-19 00:00:00': {'confirmed': 194, 'change_confirmed': '0.24358974358974358', 'deaths': 4, 'change_deaths': '0.3333333333333333', 'recovered': 15, 'change_recovered': '0.07142857142857142'}, '2020-03-20 00:00:00': {'confirmed': 244, 'change_confirmed': '0.25773195876288657', 'deaths': 5, 'change_deaths': '0.25', 'recovered': 20, 'change_recovered': '0.3333333333333333'}, '2020-03-21 00:00:00': {'confirmed': 330, 'change_confirmed': '0.3524590163934426', 'deaths': 4, 'change_deaths': '-0.2', 'recovered': 23, 'change_recovered': '0.15'}, '2020-03-22 00:00:00': {'confirmed': 396, 'change_confirmed': '0.2', 'deaths': 7, 'change_deaths': '0.75', 'recovered': 27, 'change_recovered': '0.17391304347826086'}}}}

Number of death was 5 on 2020-03-20 and it became 4 on next day ?

Value Error

I keep getting the same error when I try to use these filters:
api.filter_by_country("ireland")
api.filter_by_province("British Columbia")

ValueError: invalid literal for int() with base 10: ''

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.