Skip to content

Commit dd67b16

Browse files
authored
[Release] 3.0.2
See #28 Fixes #12 : [FIX] Car : Licence for driver but License in API Fixes #9 : [FIX] Status : Check fields before assignment Fixes #23 : [MISC] Python : 2.7 backward compatibility Fixes #21 : [MISC] Tests : Add some tests Fixes #19 : [Doc] Contributing : Add contributing guidelines [MISC] CI : Add continuous integration system Fixes #26 : [Feat] Trip : Add trip statistics
2 parents 01fe40c + b505ba2 commit dd67b16

9 files changed

Lines changed: 858 additions & 28 deletions

File tree

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: python
2+
python:
3+
- "2.7"
4+
- "3.5"
5+
# command to install dependencies
6+
install: make install
7+
# command to run tests
8+
script: make test

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.PHONY: init lint test coverage
2+
3+
install:
4+
pip install -r requirements.txt
5+
6+
lint:
7+
pylint xee --output-format=html > lint.html || true
8+
open lint.html
9+
10+
test:
11+
pip install -r test/requirements.txt
12+
python -m unittest test.test_sdk
13+
14+
coverage:
15+
coverage run -m test.test_sdk discover
16+
coverage report -m
17+
coverage html
18+
open htmlcov/index.html
19+
20+
clean:
21+
coverage erase
22+
rm lint.html || true
23+
rm -rf **/**.pyc

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,40 @@ login_url = xee.get_authentication_url()
3737
#### Getting a [token from an `authorization_code`](https://github.com/xee-lab/xee-api-docs/tree/master/api/api/v3/auth/access_token.md)
3838

3939
```python
40-
token , error = xee.get_token_from_code(authorization_code)
40+
token, error = xee.get_token_from_code(authorization_code)
4141
```
4242

4343
#### Getting a [token from an `refresh_token`](https://github.com/xee-lab/xee-api-docs/tree/master/api/api/v3/auth/access_token.md)
4444

4545
```python
46-
token , error = xee.get_token_from_refresh_token(token.refresh_token)
46+
token, error = xee.get_token_from_refresh_token(token.refresh_token)
4747
```
4848
### Requests
4949

5050
As simple as
5151

5252
```python
53-
user , error = xee.get_user(token.access_token)
53+
user, error = xee.get_user(token.access_token)
5454
print(user.id)
5555
```
5656

5757
Others examples:
5858

5959
```python
60-
status , error = xee.get_status(carId,token.access_token)
60+
status, error = xee.get_status(carId, token.access_token)
6161
print(status)
6262
```
6363

6464
```python
65-
signal , error = xee.get_signals(carId,token.access_token,names=['Odometer', 'FuelLevel'])
65+
signal, error = xee.get_signals(carId, token.access_token,names=['Odometer', 'FuelLevel'])
6666
print(signal)
6767
```
6868

69+
```python
70+
trip_duration, error = xee.get_trip_duration(tripId, token.access_token)
71+
print(trip_duration.value)
72+
```
73+
6974
See the [docs](https://github.com/quentin7b/xee-sdk-python/docs) for more about how to use it
7075

7176
## Contributing

test/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env python
2+
# coding: utf8
3+
"""This package contains nothing !"""
4+
from test.test_sdk import *

test/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
responses
2+
pytz
3+
isodate

0 commit comments

Comments
 (0)