Covid19India
A Python3 Library to get India's Covid-19 Patient Count.
Installation
pip3 install Covid19India
Requirements
- requests
- BeautifulSoup
Usage
To get India's total count
In [1]: from Covid19India import CovidIndia
In [2]: obj = CovidIndia()
In [3]: stats = obj.getstats()
In [4]: stats['total']
Out[4]: {'active': 44029, 'recovered': 20917, 'deaths': 2206, 'confirmed': 67152}
To get State and UT wise data
In [5]: stats['states']
Out[5]:
{'Andaman and Nicobar Islands': {'active': 0,
'recovered': 33,
'confirmed': 33,
'deaths': 0},
'Andhra Pradesh': {'active': 1010,
'recovered': 925,
'confirmed': 1980,
'deaths': 45},
'Arunachal Pradesh': {'active': 0,
'recovered': 1,
'confirmed': 1,
'deaths': 0},
'Assam': {'active': 27, 'recovered': 34, 'confirmed': 63, 'deaths': 2},
'Bihar': {'active': 325, 'recovered': 365, 'confirmed': 696, 'deaths': 6},
'Chandigarh': {'active': 143, 'recovered': 24, 'confirmed': 169, 'deaths': 2},
'Chhattisgarh': {'active': 10, 'recovered': 49, 'confirmed': 59, 'deaths': 0},
'Dadar Nagar Haveli': {'active': 1,
'recovered': 0,
'confirmed': 1,
'deaths': 0},
'Delhi': {'active': 4781, 'recovered': 2069, 'confirmed': 6923, 'deaths': 73},
'Goa': {'active': 0, 'recovered': 7, 'confirmed': 7, 'deaths': 0},
'Gujarat': {'active': 5156,
'recovered': 2545,
'confirmed': 8194,
'deaths': 493},
'Haryana': {'active': 393, 'recovered': 300, 'confirmed': 703, 'deaths': 10},
'Himachal Pradesh': {'active': 14,
'recovered': 39,
'confirmed': 55,
'deaths': 2},
'Jammu and Kashmir': {'active': 469,
'recovered': 383,
'confirmed': 861,
'deaths': 9},
'Jharkhand': {'active': 76, 'recovered': 78, 'confirmed': 157, 'deaths': 3},
'Karnataka': {'active': 393,
'recovered': 424,
'confirmed': 848,
'deaths': 31},
'Kerala': {'active': 19, 'recovered': 489, 'confirmed': 512, 'deaths': 4},
'Ladakh': {'active': 21, 'recovered': 21, 'confirmed': 42, 'deaths': 0},
'Madhya Pradesh': {'active': 1723,
'recovered': 1676,
'confirmed': 3614,
'deaths': 215},
'Maharashtra': {'active': 17140,
'recovered': 4199,
'confirmed': 22171,
'deaths': 832},
'Manipur': {'active': 0, 'recovered': 2, 'confirmed': 2, 'deaths': 0},
'Meghalaya': {'active': 2, 'recovered': 10, 'confirmed': 13, 'deaths': 1},
'Mizoram': {'active': 0, 'recovered': 1, 'confirmed': 1, 'deaths': 0},
'Odisha': {'active': 306, 'recovered': 68, 'confirmed': 377, 'deaths': 3},
'Puducherry': {'active': 3, 'recovered': 6, 'confirmed': 9, 'deaths': 0},
'Punjab': {'active': 1626, 'recovered': 166, 'confirmed': 1823, 'deaths': 31},
'Rajasthan': {'active': 1531,
'recovered': 2176,
'confirmed': 3814,
'deaths': 107},
'Tamil Nadu': {'active': 5198,
'recovered': 1959,
'confirmed': 7204,
'deaths': 47},
'Telengana': {'active': 416,
'recovered': 750,
'confirmed': 1196,
'deaths': 30},
'Tripura': {'active': 148, 'recovered': 2, 'confirmed': 150, 'deaths': 0},
'Uttarakhand': {'active': 21, 'recovered': 46, 'confirmed': 68, 'deaths': 1},
'Uttar Pradesh': {'active': 1740,
'recovered': 1653,
'confirmed': 3467,
'deaths': 74},
'West Bengal': {'active': 1337,
'recovered': 417,
'confirmed': 1939,
'deaths': 185}}
To get time at which data has been updated
In [6]: stats['time']
Out[6]: '11 May 2020, 08:00 IST (GMT+5:30)'
To get India's Historical data
In [7]: hist = obj.gethistorical()
In [8]: hist
Out[8]:
{'cases': {'1/22/20': 0,
'1/23/20': 0,
'1/24/20': 0,
'1/25/20': 0,
'1/26/20': 0,
'1/27/20': 0,
'1/28/20': 0,
'1/29/20': 0,
'1/30/20': 1,
'1/31/20': 1,
'2/1/20': 1,
'2/2/20': 2,
'2/3/20': 3,
'2/4/20': 3,
'2/5/20': 3,
'2/6/20': 3,
'2/7/20': 3,
'2/8/20': 3,
'2/9/20': 3,
'2/10/20': 3,
'2/11/20': 3,
'2/12/20': 3,
'2/13/20': 3,
'2/14/20': 3,
'2/15/20': 3,
'2/16/20': 3,
'2/17/20': 3,
'2/18/20': 3,
'2/19/20': 3,
'2/20/20': 3,
'2/21/20': 3,
'2/22/20': 3,
'2/23/20': 3,
'2/24/20': 3,
'2/25/20': 3,
'2/26/20': 3,
'2/27/20': 3,
'2/28/20': 3,
'2/29/20': 3,
'3/1/20': 3,
'3/2/20': 5,
'3/3/20': 5,
'3/4/20': 28,
'3/5/20': 30,
'3/6/20': 31,
'3/7/20': 34,
'3/8/20': 39,
'3/9/20': 43,
'3/10/20': 56,
'3/11/20': 62,
'3/12/20': 73,
'3/13/20': 82,
'3/14/20': 102,
'3/15/20': 113,
'3/16/20': 119,
'3/17/20': 142,
'3/18/20': 156,
'3/19/20': 194,
'3/20/20': 244,
'3/21/20': 330,
'3/22/20': 396,
'3/23/20': 499,
'3/24/20': 536,
'3/25/20': 657,
'3/26/20': 727,
'3/27/20': 887,
'3/28/20': 987,
'3/29/20': 1024,
'3/30/20': 1251,
'3/31/20': 1397,
'4/1/20': 1998,
'4/2/20': 2543,
'4/3/20': 2567,
'4/4/20': 3082,
'4/5/20': 3588,
'4/6/20': 4778,
'4/7/20': 5311,
'4/8/20': 5916,
'4/9/20': 6725,
'4/10/20': 7598,
'4/11/20': 8446,
'4/12/20': 9205,
'4/13/20': 10453,
'4/14/20': 11487,
'4/15/20': 12322,
'4/16/20': 13430,
'4/17/20': 14352,
'4/18/20': 15722,
'4/19/20': 17615,
'4/20/20': 18539,
'4/21/20': 20080,
'4/22/20': 21370,
'4/23/20': 23077,
'4/24/20': 24530,
'4/25/20': 26283,
'4/26/20': 27890,
'4/27/20': 29451,
'4/28/20': 31324,
'4/29/20': 33062,
'4/30/20': 34863,
'5/1/20': 37257,
'5/2/20': 39699,
'5/3/20': 42505,
'5/4/20': 46437,
'5/5/20': 49400,
'5/6/20': 52987,
'5/7/20': 56351,
'5/8/20': 59695,
'5/9/20': 62808,
'5/10/20': 67161},
'deaths': {'1/22/20': 0,
'1/23/20': 0,
'1/24/20': 0,
'1/25/20': 0,
'1/26/20': 0,
'1/27/20': 0,
'1/28/20': 0,
'1/29/20': 0,
'1/30/20': 0,
'1/31/20': 0,
'2/1/20': 0,
'2/2/20': 0,
'2/3/20': 0,
'2/4/20': 0,
'2/5/20': 0,
'2/6/20': 0,
'2/7/20': 0,
'2/8/20': 0,
'2/9/20': 0,
'2/10/20': 0,
'2/11/20': 0,
'2/12/20': 0,
'2/13/20': 0,
'2/14/20': 0,
'2/15/20': 0,
'2/16/20': 0,
'2/17/20': 0,
'2/18/20': 0,
'2/19/20': 0,
'2/20/20': 0,
'2/21/20': 0,
'2/22/20': 0,
'2/23/20': 0,
'2/24/20': 0,
'2/25/20': 0,
'2/26/20': 0,
'2/27/20': 0,
'2/28/20': 0,
'2/29/20': 0,
'3/1/20': 0,
'3/2/20': 0,
'3/3/20': 0,
'3/4/20': 0,
'3/5/20': 0,
'3/6/20': 0,
'3/7/20': 0,
'3/8/20': 0,
'3/9/20': 0,
'3/10/20': 0,
'3/11/20': 1,
'3/12/20': 1,
'3/13/20': 2,
'3/14/20': 2,
'3/15/20': 2,
'3/16/20': 2,
'3/17/20': 3,
'3/18/20': 3,
'3/19/20': 4,
'3/20/20': 5,
'3/21/20': 4,
'3/22/20': 7,
'3/23/20': 10,
'3/24/20': 10,
'3/25/20': 12,
'3/26/20': 20,
'3/27/20': 20,
'3/28/20': 24,
'3/29/20': 27,
'3/30/20': 32,
'3/31/20': 35,
'4/1/20': 58,
'4/2/20': 72,
'4/3/20': 72,
'4/4/20': 86,
'4/5/20': 99,
'4/6/20': 136,
'4/7/20': 150,
'4/8/20': 178,
'4/9/20': 226,
'4/10/20': 246,
'4/11/20': 288,
'4/12/20': 331,
'4/13/20': 358,
'4/14/20': 393,
'4/15/20': 405,
'4/16/20': 448,
'4/17/20': 486,
'4/18/20': 521,
'4/19/20': 559,
'4/20/20': 592,
'4/21/20': 645,
'4/22/20': 681,
'4/23/20': 721,
'4/24/20': 780,
'4/25/20': 825,
'4/26/20': 881,
'4/27/20': 939,
'4/28/20': 1008,
'4/29/20': 1079,
'4/30/20': 1154,
'5/1/20': 1223,
'5/2/20': 1323,
'5/3/20': 1391,
'5/4/20': 1566,
'5/5/20': 1693,
'5/6/20': 1785,
'5/7/20': 1889,
'5/8/20': 1985,
'5/9/20': 2101,
'5/10/20': 2212},
'recovered': {'1/22/20': 0,
'1/23/20': 0,
'1/24/20': 0,
'1/25/20': 0,
'1/26/20': 0,
'1/27/20': 0,
'1/28/20': 0,
'1/29/20': 0,
'1/30/20': 0,
'1/31/20': 0,
'2/1/20': 0,
'2/2/20': 0,
'2/3/20': 0,
'2/4/20': 0,
'2/5/20': 0,
'2/6/20': 0,
'2/7/20': 0,
'2/8/20': 0,
'2/9/20': 0,
'2/10/20': 0,
'2/11/20': 0,
'2/12/20': 0,
'2/13/20': 0,
'2/14/20': 0,
'2/15/20': 0,
'2/16/20': 3,
'2/17/20': 3,
'2/18/20': 3,
'2/19/20': 3,
'2/20/20': 3,
'2/21/20': 3,
'2/22/20': 3,
'2/23/20': 3,
'2/24/20': 3,
'2/25/20': 3,
'2/26/20': 3,
'2/27/20': 3,
'2/28/20': 3,
'2/29/20': 3,
'3/1/20': 3,
'3/2/20': 3,
'3/3/20': 3,
'3/4/20': 3,
'3/5/20': 3,
'3/6/20': 3,
'3/7/20': 3,
'3/8/20': 3,
'3/9/20': 3,
'3/10/20': 4,
'3/11/20': 4,
'3/12/20': 4,
'3/13/20': 4,
'3/14/20': 4,
'3/15/20': 13,
'3/16/20': 13,
'3/17/20': 14,
'3/18/20': 14,
'3/19/20': 15,
'3/20/20': 20,
'3/21/20': 23,
'3/22/20': 27,
'3/23/20': 27,
'3/24/20': 40,
'3/25/20': 43,
'3/26/20': 45,
'3/27/20': 73,
'3/28/20': 84,
'3/29/20': 95,
'3/30/20': 102,
'3/31/20': 123,
'4/1/20': 148,
'4/2/20': 191,
'4/3/20': 192,
'4/4/20': 229,
'4/5/20': 229,
'4/6/20': 375,
'4/7/20': 421,
'4/8/20': 506,
'4/9/20': 620,
'4/10/20': 774,
'4/20/20': 3273,
'4/21/20': 3975,
'4/22/20': 4370,
'4/23/20': 5012,
'4/24/20': 5498,
'4/25/20': 5939,
'4/26/20': 6523,
'4/27/20': 7137,
'4/28/20': 7747,
'4/29/20': 8437,
'4/30/20': 9068,
'5/1/20': 10007,
'5/2/20': 10819,
'5/3/20': 11775,
'5/4/20': 12847,
'5/5/20': 14142,
'5/6/20': 15331,
'5/7/20': 16776,
'5/8/20': 17887,
'5/9/20': 19301,
'5/10/20': 20969}}11/20': 969,
'4/12/20': 1080,
'4/13/20': 1181,
'4/14/20': 1359,
'4/15/20': 1432,
'4/16/20': 1768,
'4/17/20': 2041,
'4/18/20': 2463,
'4/19/20': 2854,
'4/20/20': 3273,
'4/21/20': 3975,
'4/22/20': 4370,
'4/23/20': 5012,
'4/24/20': 5498,
'4/25/20': 5939,
'4/26/20': 6523,
'4/27/20': 7137,
'4/28/20': 7747,
'4/29/20': 8437,
'4/30/20': 9068,
'5/1/20': 10007,
'5/2/20': 10819,
'5/3/20': 11775,
'5/4/20': 12847,
'5/5/20': 14142,
'5/6/20': 15331,
'5/7/20': 16776,
'5/8/20': 17887,
'5/9/20': 19301,
'5/10/20': 20969}}
Data Source
- Ministry of Health and Family Welfar Govt of India: For latest counts
- NovelCovid: For historical data
Metadata
Release files for Covid19India 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| Covid19India-0.0.5.tar.gz | 6.1 kB | Without provenance | Details for Covid19India-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Covid19India-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for Covid19India-0.0.5-py3-none-any.whl |
Total release size: 12.0 kB
Release files / Covid19India-0.0.5.tar.gz
| Download URL | Covid19India-0.0.5.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
372df5650f01dc7a44d49e2327801c98487ca68f476efc8c51e369963e2f9005
|
|
BLAKE2b-256 checksum How to use checksums |
d7866779c2a3f92cf08f4c7168d2831b5a35fc568ae97e9c93398a7e55020996
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
|
Release files / Covid19India-0.0.5-py3-none-any.whl
| Download URL | Covid19India-0.0.5-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c796abd42761a05c1099ee26d96b018f3567180c5ba201583c803c1ccd26516a
|
|
BLAKE2b-256 checksum How to use checksums |
41ad9ff896110afa99b8af421d9eb2ae87749f0d599746254e104fb932e1c9be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
|
Security for Covid19India 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.