Commit 74fa513e authored by Maël Kervella's avatar Maël Kervella
Browse files

Proper support for ISO-8601 dates

parent de759e41
## Re2o - API client
This project is providing an abstraction layer to easily use the API of Re2o.
## Requirements
* python3
* python3-iso8601
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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment