A basic API wrapper to interact with https://corona.lmao.ninja/.
Project description
Covid 19 API Wrapper
THE API CREDIT GOES TO corona.lmao.ninja, big thanks!
Their Discord
Python API Wrapper
Interacts with the API. Hopefully this saves some people a few steps :) Enjoy!
[Fixed] API endpoint changed to "corona.lmao.ninja/v2/"
UPDATE [...0.0.4] [Fixed]
Until this fix [~0.0.4], functionality was broken due to changes made to the API endpoint sometime today, April 17th, 2020.
All is well and working now :)
And remember: Social-distancing is key!!
Without using "countries" endpoint:
from Covid19ApiWrapper import *
#define the object
x = covidUpdate(BOOL_country_data=False)
print(x.totalCases)
print(x.totalDeaths)
print(x.totalRecovered)
print(x.timeUpdatedUnix)
Using both endpoints:
from Covid19ApiWrapper import *
#define the object
x = covidUpdate(BOOL_country_data=True)
print(x.totalCases)
print(x.totalDeaths)
print(x.totalRecovered)
print(x.timeUpdatedUnix)
#Possible Usage: cases, todayCases, deaths, todayDeaths, recovered, active, critical, casesPerOneMillion
print(x.countryData['China']['cases'])
print(x.countryData['China']['todayCases'])
Download/Interact With CDC World Map:
from Covid19ApiWrapper import *
#GET CURRENT CDC GLOBAL INFECTION MAP/LINKS
x = getCdcWorldMap()
print(x.WorldMapLocalFile)
print(x.WorldMapLink)
print(x.WorldMapHtml)
#GET FLAG LINKS/DOWNLOAD FLAG PNG
y = getCountryFlag("USA", download=True)
print(y.flagLink)
print(y.flagLocalFile)
print(y.flagHtml)
Enjoy and be safe!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Covid19ApiWrapper-0.0.4.tar.gz.
File metadata
- Download URL: Covid19ApiWrapper-0.0.4.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
656931fddc238094c490d29f8e61618f86634adb1715ee4ad6ef065f3969f2bf
|
|
| MD5 |
75d8c3446c418d16b532cc89816f6973
|
|
| BLAKE2b-256 |
90f18609a68e370deabca08ee7fb1cf8ecce85f807929472ebe1c0590eb539de
|
File details
Details for the file Covid19ApiWrapper-0.0.4-py3-none-any.whl.
File metadata
- Download URL: Covid19ApiWrapper-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
166afae9ad12d3e603f6b3359d8a804222e4f2d9798323d7a6f949fe86508e32
|
|
| MD5 |
719cef624116647db61775adfd9e4066
|
|
| BLAKE2b-256 |
eedc3db61997473a16cb79059a1c6da5f6184b5477fe93378132ea310349cf43
|