https://github.com/qk7b/xee-sdk-python
DEPRECATED - A python SDK for Xee APIs
https://github.com/qk7b/xee-sdk-python
python python-library sdk xee xee-apis
Last synced: 3 months ago
JSON representation
DEPRECATED - A python SDK for Xee APIs
- Host: GitHub
- URL: https://github.com/qk7b/xee-sdk-python
- Owner: qk7b
- License: other
- Created: 2016-07-12T17:25:04.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-05-12T08:15:45.000Z (about 6 years ago)
- Last Synced: 2025-07-03T19:44:38.581Z (11 months ago)
- Topics: python, python-library, sdk, xee, xee-apis
- Language: Python
- Homepage:
- Size: 410 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/tikismoke) made.
Please reach [this repository for up-to-date sdk](https://github.com/tikismoke/xee-sdk-python)
---
# Xee SDK Python
[](https://travis-ci.org/quentin7b/xee-sdk-python)
[](./LICENSE)
[](https://github.com/quentin7b/xee-sdk-python/releases/tag/3.0.2)
A utility library for [Xee API](https://dev.xee.com) with Python 3.
> Almost all the requests are done for you and the responses are returned as a **tuple**s.
## Install
* Clone and `python setup.py install` :)
## Initializing the SDK
```python
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](https://github.com/xee-lab/xee-api-docs/tree/master/api/api/v3/auth/auth.md)
```python
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`](https://github.com/xee-lab/xee-api-docs/tree/master/api/api/v3/auth/access_token.md)
```python
token, error = xee.get_token_from_code(authorization_code)
```
#### Getting a [token from an `refresh_token`](https://github.com/xee-lab/xee-api-docs/tree/master/api/api/v3/auth/access_token.md)
```python
token, error = xee.get_token_from_refresh_token(token.refresh_token)
```
### Requests
As simple as
```python
user, error = xee.get_user(token.access_token)
print(user.id)
```
Others examples:
```python
status, error = xee.get_status(carId, token.access_token)
print(status)
```
```python
signal, error = xee.get_signals(carId, token.access_token,names=['Odometer', 'FuelLevel'])
print(signal)
```
```python
trip_duration, error = xee.get_trip_duration(tripId, token.access_token)
print(trip_duration.value)
```
See the [docs](https://github.com/quentin7b/xee-sdk-python/docs) for more about how to use it
## Contributing
I'm pretty new to *python*.
Tried to follow some "guidelines" I found:
- http://sametmax.com/planet-python-fr/
- https://github.com/kennethreitz/python-guide
- ...
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
- [isodate](https://pypi.python.org/pypi/isodate)
- [requests](https://pypi.python.org/pypi/requests)
And to test
- [responses](https://pypi.python.org/pypi/responses)
- [pytz](https://pypi.python.org/pypi/pytz)