As I can't find time to work on this project anymore, but the Xee API continues to move forward, this project is now deprecated. By chance, you can find an up-to-date project on the fork tikismoke made.
Please reach this repository for up-to-date sdk
A utility library for Xee API with Python 3.
Almost all the requests are done for you and the responses are returned as a tuples.
- Clone and
python setup.py install
:)
from xee import Xee
xee = Xee(client_id="your_client_id",
client_secret="your_client_secret",
redirect_uri="your://redirect:uri")
Getting the access code url
login_url = xee.get_authentication_url()
Then show the webpage to the end user, once the process is complete, we'll redirect to
redirect_uri?code={authorization_code}
. Keep this code in mind
Getting a token from an authorization_code
token, error = xee.get_token_from_code(authorization_code)
Getting a token from an refresh_token
token, error = xee.get_token_from_refresh_token(token.refresh_token)
As simple as
user, error = xee.get_user(token.access_token)
print(user.id)
Others examples:
status, error = xee.get_status(carId, token.access_token)
print(status)
signal, error = xee.get_signals(carId, token.access_token,names=['Odometer', 'FuelLevel'])
print(signal)
trip_duration, error = xee.get_trip_duration(tripId, token.access_token)
print(trip_duration.value)
See the docs for more about how to use it
I'm pretty new to python.
Tried to follow some "guidelines" I found:
But might be doing things in a wrong way so, feel free to fork, issue, pr, everything to improve this !
To build this, I used some very useful libraries
And to test