Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nounous
re2o-re2oapi
Commits
74fa513e
Commit
74fa513e
authored
May 24, 2018
by
Maël Kervella
Browse files
Proper support for ISO-8601 dates
parent
de759e41
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
74fa513e
## Re2o - API client
This project is providing an abstraction layer to easily use the API of Re2o.
## Requirements
*
python3
*
python3-iso8601
re2oapi/client.py
View file @
74fa513e
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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment