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 covid-19-api-wrapper 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 covid-19-api-wrapper 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'])

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

Covid19ApiWrapper-0.0.1.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

Covid19ApiWrapper-0.0.1-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page