diff --git a/corona_api/__init__.py b/corona_api/__init__.py index dec84b7..2df9a55 100644 --- a/corona_api/__init__.py +++ b/corona_api/__init__.py @@ -3,6 +3,6 @@ from .statistics import * from .utils import * -__version__ = "0.8.2" +__version__ = "0.8.4" __author__ = "Rob Wainwright // apex2504" __license__ = "MIT" \ No newline at end of file diff --git a/corona_api/client.py b/corona_api/client.py index 5af74d4..41ff11e 100644 --- a/corona_api/client.py +++ b/corona_api/client.py @@ -737,3 +737,28 @@ async def apple_mobility_data(self, country, subregion): subregion_string, statistics ) + + + async def gov_supported_countries(self): + """ + Get a list of countries supported by Governmental data + """ + endpoint = GOV_ALL.format(self.api_url) + data = await self.request_client.make_request(endpoint) + + return data + + + async def gov_country(self, country): + """ + Get the data from the Government of a specified country. + + The data comes from the website of the government of each country so it is difficult to produce a standardised format. + As a result, we cannot create a unified class for such data. Therefore, returned data will be a list of dicts. + + To get a list of attributes, you can use `list(data.keys())` + """ + endpoint = GOV_COUNTRY.format(self.api_url, country) + data = await self.request_client.make_request(endpoint) + + return data \ No newline at end of file diff --git a/corona_api/endpoints.py b/corona_api/endpoints.py index 09fcf49..65b2c68 100644 --- a/corona_api/endpoints.py +++ b/corona_api/endpoints.py @@ -25,4 +25,7 @@ APPLE_COUNTRIES = '{}/apple/countries' APPLE_SUBREGIONS = APPLE_COUNTRIES + '/{}' -APPLE_SINGLE_SUBREGION = APPLE_SUBREGIONS + '/{}' \ No newline at end of file +APPLE_SINGLE_SUBREGION = APPLE_SUBREGIONS + '/{}' + +GOV_ALL = '{}/gov' +GOV_COUNTRY = GOV_ALL + '/{}' \ No newline at end of file diff --git a/corona_api/request.py b/corona_api/request.py index e40d339..20b3cb3 100644 --- a/corona_api/request.py +++ b/corona_api/request.py @@ -1,7 +1,7 @@ import aiohttp from .exceptions import NotFound, APIError -ver = "0.8.2" +ver = "0.8.4" class RequestClient: def __init__(self): diff --git a/setup.py b/setup.py index d899d98..dd8546c 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name = 'corona_api', packages = ['corona_api'], - version = '0.8.2', + version = '0.8.4', license='MIT', description = 'An asynchronous wrapper for the corona.lmao.ninja API written in Python.', long_description= long_desc,