Skip to content

quentin7b/xee-sdk-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated

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


Xee SDK Python

Build Status License Apache Version

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.

Install

  • Clone and python setup.py install :)

Initializing the SDK

from xee import Xee

xee = Xee(client_id="your_client_id", 
		client_secret="your_client_secret", 
		redirect_uri="your://redirect:uri")

Using the SDK

Authentication

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

token, error = xee.get_token_from_code(authorization_code)
token, error = xee.get_token_from_refresh_token(token.refresh_token)

Requests

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

Contributing

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 !

Dependencies

To build this, I used some very useful libraries

And to test