From e4238ab51dd29c17fb31090f9d37fb59c69a5af8 Mon Sep 17 00:00:00 2001 From: Colin-J-School <80839554+Colin-J-School@users.noreply.github.com> Date: Wed, 17 Mar 2021 12:49:49 -0400 Subject: [PATCH] Update covid19.py --- COVID19Py/covid19.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/COVID19Py/covid19.py b/COVID19Py/covid19.py index a68faa7..b7d2203 100644 --- a/COVID19Py/covid19.py +++ b/COVID19Py/covid19.py @@ -156,3 +156,11 @@ def getLocationById(self, country_id: int): """ data = self._request("/v2/locations/" + str(country_id)) return data["location"] + + def checkForType(countryToCheck): + if isinstance(checker, int): + getLocationById(countryToCheck) + elif len(checker) <=2: + getLocationByCountryCode(countryToCheck) + else: + getLocationByCountry(countryToCheck)