Covid Tracker Using Python || Python Micro-Project

 Covid Tracker Using Python 

Today we will see the how to access the Covid data using Python. For this we will be using Covid Module develop by Johns Hopkins University and collects the data using worldometers.info website. This modules has the following information: 
  • Active Covid Cases
  • Total Deaths
  • Total Cases
  • Total Recovered Cases
  • 190 countries Data with above information

Module Installation

To install the Covid Module type the following: 

pip install covid

This module has various functions to access the Covid Data that makes it easy to handle and collect the data.

Built-in Methods

Get_data()

Result:
[
    {
        'id': '53',
        'country': 'China',
        'confirmed': 81020,
        'active': 9960,
        'deaths': 3217,
        'recovered': 67843,
        'latitude': 30.5928,
        'longitude': 114.3055,
        'last_update': 1584097775000
    },
    {
        'id': '115',
        'country': 'Italy',
        'confirmed': 24747,
        'active': 20603,
        'deaths': 1809,
        'recovered': 2335,
        'latitude': 41.8719,
        'longitude': 12.5674,
        'last_update': 1584318130000
    },
    ...
]

List_Countries()

Result:
[
    {'id': '117', 'country': 'US'},
    {'id': '80', 'country': 'India'}
    ...
]

Get_Status_By_Country_Name('country_Name')

Result:
{
    'id': '80',
    'country': 'India',
    'confirmed': 9499413,
    'active': 428644,
    'deaths': 138122,
    'recovered': 8932647,
    'latitude': 20.593684,
    'longitude': 78.96288,
    'last_update': 1606915680000
}

Get_Status_By_Country_Id('Id')

Result:
{
    'id': '80',
    'country': 'India',
    'confirmed': 9499413,
    'active': 428644,
    'deaths': 138122,
    'recovered': 8932647,
    'latitude': 20.593684,
    'longitude': 78.96288,
    'last_update': 1606915680000
}

Get_Total_Active_Cases()

Result:
21347443

Get_Total_Deaths()


Get_Total_Recovered()


You can get access to the Module Documentation from here.


 Having any problem regarding programming related stuff !!! Feel free to dm me on my Social Media Handle Instagram


Check my Portfolioprathmeshchaudhari.me

Subscribe to my Blog & comment below !!!


Comments