Skip to content

Simple Python webservice to provide the latest statistics about Coronavirus COVID-19 in JSON format.

License

Notifications You must be signed in to change notification settings

mahmoudadel2/covid19-webservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

covid19-webservice

Simple Python webservice to provide the latest statistics about Coronavirus COVID-19 in JSON format.

Running local/dev

Prerequisites

pip install -r requirements.txt

Start the webservice

python -m covid19_webservice

Running on production

Build an image

docker build -t covid19-webservice .

Run the container

docker run -d --name covid19-webservice -p 8080:8080 covid19-webservice

Usage

I've listed the available endpoints in the webservice home page, e.g. http://localhost:8080/

Examples

Getting a country by name (German):

curl http://localhost:8080/get/country/name/Ägypten
{
    "confirmed": 49, 
    "deaths": 1, 
    "lat": 26.0, 
    "lon": 30.0, 
    "recovered": 1, 
    "updated": "2020-03-08 19:03:11"
}

Getting a city by name (German):

curl http://localhost:8080/get/city/name/Deutschland/Bayern
{
    "confirmed": 200, 
    "deaths": 0, 
    "lat": 48.768814, 
    "lon": 11.658164999999999, 
    "recovered": 14, 
    "updated": "2020-03-08 17:00:00"
}