diff --git a/corona/__init__.py b/corona/__init__.py index ce3618b..8b9d4b5 100644 --- a/corona/__init__.py +++ b/corona/__init__.py @@ -1,4 +1,4 @@ -VERSION = "0.0.1" +VERSION = "0.0.2" __version__ = VERSION __license__ = "MIT" __author__ = "NANI" diff --git a/corona/objects.py b/corona/objects.py index 908dbb0..e9f34f4 100644 --- a/corona/objects.py +++ b/corona/objects.py @@ -1,9 +1,12 @@ import abc +import sys from datetime import datetime, timezone ASCII_LOWER = "abcdefghijklmnopqrstuvwxyz0123456789" OFFSET = 127397 +DATE_ISOFRMT36 = sys.version.startswith("3.6") + class Country: def __init__(self, country_name, **data): @@ -84,7 +87,8 @@ def __init__(self, **data): class JHUCSSE(CountryProvinceHead): def __init__(self, **data): super().__init__(**data) - self.updated_at = datetime.fromisoformat(data.get('updatedAt')) # type: datetime + self.updated_at = datetime.strptime(data.get('updatedAt'), "%Y-%m-%d %H:%M:%S") if DATE_ISOFRMT36 else \ + datetime.fromisoformat(data.get('updatedAt')) # type: datetime stats = data.get('stats') self.confirmed = stats.get('confirmed') # type: int self.deaths = stats.get('deaths') # type: int diff --git a/setup.py b/setup.py index 4889366..5b6e08f 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='corona.py', packages=['corona'], - version='0.0.1', + version='0.0.2', license='MIT', description='An asynchronous wrapper for the corona.lmao.ninja API written in Python with Discord.py plugin.', long_description=long_desc,