Skip to main content

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!


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.

Files for Covid19ApiWrapper, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size Covid19ApiWrapper-0.0.3-py3-none-any.whl (4.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size Covid19ApiWrapper-0.0.3.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page