diff --git a/README.md b/README.md index 2f197ae..f4196a1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ ## Re2o - API client This project is providing an abstraction layer to easily use the API of Re2o. + +## Requirements + +* python3 +* python3-iso8601 diff --git a/re2oapi/client.py b/re2oapi/client.py index 54c28df..13f120d 100644 --- a/re2oapi/client.py +++ b/re2oapi/client.py @@ -1,6 +1,7 @@ import requests from requests.exceptions import HTTPError import datetime +import iso8601 from . import endpoints from . import exceptions @@ -32,10 +33,7 @@ class Re2oAPIClient: response = response.json() return { 'token': response['token'], - 'expiration': datetime.datetime.strptime( - response['expiration'], - '%Y-%m-%dT%H:%M:%S.%fZ' - ) + 'expiration': iso8601.parse_date(response['expiration']) } def get_token(self):