dimo-python-sdk 0.0.6__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/PKG-INFO +2 -2
- dimo_python_sdk-1.0.0/dimo/api/attestation.py +24 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/device_data.py +9 -9
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/devices.py +12 -12
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/trips.py +2 -2
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/dimo.py +2 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo_python_sdk.egg-info/PKG-INFO +2 -2
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo_python_sdk.egg-info/SOURCES.txt +1 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo_python_sdk.egg-info/requires.txt +1 -1
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/pyproject.toml +2 -2
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/LICENSE +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/README.md +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/__init__.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/__init__.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/auth.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/device_definitions.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/events.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/token_exchange.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/user.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/valuations.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/api/vehicle_signal_decoding.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/constants.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/environments.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/errors.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/eth_signer.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/graphql/__init__.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/graphql/identity.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/graphql/telemetry.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo/request.py +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo_python_sdk.egg-info/dependency_links.txt +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo_python_sdk.egg-info/top_level.txt +0 -0
- {dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dimo-python-sdk
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: DIMO SDK in Python
|
|
5
5
|
Author-email: Barrett Kowalsky <barrettkowalsky@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/DIMO-Network/dimo-python-sdk
|
|
@@ -13,7 +13,7 @@ Requires-Python: >=3.8
|
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: requests>=2.30.0
|
|
16
|
-
Requires-Dist:
|
|
16
|
+
Requires-Dist: eth-account==0.13.4
|
|
17
17
|
Requires-Dist: eth-utils==4.1.1
|
|
18
18
|
|
|
19
19
|
# DIMO Python Developer SDK
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from dimo.errors import check_type
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Attestation:
|
|
5
|
+
def __init__(self, request_method, get_auth_headers):
|
|
6
|
+
self._request = request_method
|
|
7
|
+
self._get_auth_headers = get_auth_headers
|
|
8
|
+
|
|
9
|
+
def create_vin_vc(self, privileged_token: str, token_id: int) -> dict:
|
|
10
|
+
check_type("privileged_token", privileged_token, str)
|
|
11
|
+
check_type("token_id", token_id, int)
|
|
12
|
+
params = {"force": True}
|
|
13
|
+
url = f"/v1/vc/vin/{token_id}"
|
|
14
|
+
return self._request(
|
|
15
|
+
"POST", "Attestation", url, params=params, headers=self._get_auth_headers(privileged_token)
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
def create_pom_vc(self, privileged_token: str, token_id: int) -> dict:
|
|
19
|
+
check_type("privileged_token", privileged_token, str)
|
|
20
|
+
check_type("token_id", token_id, int)
|
|
21
|
+
url = f"/v1/vc/pom/{token_id}"
|
|
22
|
+
return self._request(
|
|
23
|
+
"POST", "Attestation", url, headers=self._get_auth_headers(privileged_token)
|
|
24
|
+
)
|
|
@@ -11,7 +11,7 @@ class DeviceData:
|
|
|
11
11
|
def get_vehicle_history(
|
|
12
12
|
self,
|
|
13
13
|
privileged_token: str,
|
|
14
|
-
token_id:
|
|
14
|
+
token_id: int,
|
|
15
15
|
start_time: Optional[str] = None,
|
|
16
16
|
end_time: Optional[str] = None,
|
|
17
17
|
buckets: Optional[str] = None,
|
|
@@ -32,9 +32,9 @@ class DeviceData:
|
|
|
32
32
|
headers=self._get_auth_headers(privileged_token),
|
|
33
33
|
)
|
|
34
34
|
|
|
35
|
-
def get_vehicle_status(self, privileged_token: str, token_id:
|
|
35
|
+
def get_vehicle_status(self, privileged_token: str, token_id: int) -> dict:
|
|
36
36
|
check_type("privileged_token", privileged_token, str)
|
|
37
|
-
check_type("token_id", token_id,
|
|
37
|
+
check_type("token_id", token_id, int)
|
|
38
38
|
url = f"/v2/vehicle/{token_id}/status"
|
|
39
39
|
return self._request(
|
|
40
40
|
"GET", "DeviceData", url, headers=self._get_auth_headers(privileged_token)
|
|
@@ -43,12 +43,12 @@ class DeviceData:
|
|
|
43
43
|
def get_v1_vehicle_history(
|
|
44
44
|
self,
|
|
45
45
|
privileged_token: str,
|
|
46
|
-
token_id:
|
|
46
|
+
token_id: int,
|
|
47
47
|
start_date: Optional[str] = None,
|
|
48
48
|
end_date: Optional[str] = None,
|
|
49
49
|
) -> dict:
|
|
50
50
|
check_type("privileged_token", privileged_token, str)
|
|
51
|
-
check_type("token_id", token_id,
|
|
51
|
+
check_type("token_id", token_id, int)
|
|
52
52
|
check_optional_type("start_date", start_date, str)
|
|
53
53
|
check_optional_type("end_date", end_date, str)
|
|
54
54
|
params = {}
|
|
@@ -65,17 +65,17 @@ class DeviceData:
|
|
|
65
65
|
headers=self._get_auth_headers(privileged_token),
|
|
66
66
|
)
|
|
67
67
|
|
|
68
|
-
def get_v1_vehicle_status(self, privileged_token: str, token_id:
|
|
68
|
+
def get_v1_vehicle_status(self, privileged_token: str, token_id: int) -> dict:
|
|
69
69
|
check_type("privileged_token", privileged_token, str)
|
|
70
|
-
check_type("token_id", token_id,
|
|
70
|
+
check_type("token_id", token_id, int)
|
|
71
71
|
url = f"/v1/vehicle/{token_id}/status"
|
|
72
72
|
return self._request(
|
|
73
73
|
"GET", "DeviceData", url, headers=self._get_auth_headers(privileged_token)
|
|
74
74
|
)
|
|
75
75
|
|
|
76
|
-
def get_v1_vehicle_status_raw(self, privileged_token: str, token_id:
|
|
76
|
+
def get_v1_vehicle_status_raw(self, privileged_token: str, token_id: int) -> dict:
|
|
77
77
|
check_type("privileged_token", privileged_token, str)
|
|
78
|
-
check_type("token_id", token_id,
|
|
78
|
+
check_type("token_id", token_id, int)
|
|
79
79
|
url = f"/v1/vehicle/{token_id}/status-raw"
|
|
80
80
|
return self._request(
|
|
81
81
|
"GET", "DeviceData", url, headers=self._get_auth_headers(privileged_token)
|
|
@@ -174,33 +174,33 @@ class Devices:
|
|
|
174
174
|
data=body,
|
|
175
175
|
)
|
|
176
176
|
|
|
177
|
-
def lock_doors(self, privilege_token: str, token_id:
|
|
177
|
+
def lock_doors(self, privilege_token: str, token_id: int):
|
|
178
178
|
check_type("privilege_token", privilege_token, str)
|
|
179
|
-
check_type("token_id", token_id,
|
|
179
|
+
check_type("token_id", token_id, int)
|
|
180
180
|
url = f"/v1/vehicle/{token_id}/commands/doors/lock"
|
|
181
181
|
return self._request(
|
|
182
182
|
"POST", "Devices", url, headers=self._get_auth_headers(privilege_token)
|
|
183
183
|
)
|
|
184
184
|
|
|
185
|
-
def unlock_doors(self, privilege_token: str, token_id:
|
|
185
|
+
def unlock_doors(self, privilege_token: str, token_id: int):
|
|
186
186
|
check_type("privilege_token", privilege_token, str)
|
|
187
|
-
check_type("token_id", token_id,
|
|
187
|
+
check_type("token_id", token_id, int)
|
|
188
188
|
url = f"/v1/vehicle/{token_id}/commands/doors/unlock"
|
|
189
189
|
return self._request(
|
|
190
190
|
"POST", "Devices", url, headers=self._get_auth_headers(privilege_token)
|
|
191
191
|
)
|
|
192
192
|
|
|
193
|
-
def open_frunk(self, privilege_token: str, token_id:
|
|
193
|
+
def open_frunk(self, privilege_token: str, token_id: int):
|
|
194
194
|
check_type("privilege_token", privilege_token, str)
|
|
195
|
-
check_type("token_id", token_id,
|
|
195
|
+
check_type("token_id", token_id, int)
|
|
196
196
|
url = f"/v1/vehicle/{token_id}/commands/frunk/open"
|
|
197
197
|
return self._request(
|
|
198
198
|
"POST", "Devices", url, headers=self._get_auth_headers(privilege_token)
|
|
199
199
|
)
|
|
200
200
|
|
|
201
|
-
def open_trunk(self, privilege_token: str, token_id:
|
|
201
|
+
def open_trunk(self, privilege_token: str, token_id: int):
|
|
202
202
|
check_type("privilege_token", privilege_token, str)
|
|
203
|
-
check_type("token_id", token_id,
|
|
203
|
+
check_type("token_id", token_id, int)
|
|
204
204
|
url = f"/v1/vehicle/{token_id}/commands/trunk/open"
|
|
205
205
|
return self._request(
|
|
206
206
|
"POST", "Devices", url, headers=self._get_auth_headers(privilege_token)
|
|
@@ -238,13 +238,13 @@ class Devices:
|
|
|
238
238
|
"POST", "Devices", url, headers=self._get_auth_headers(access_token)
|
|
239
239
|
)
|
|
240
240
|
|
|
241
|
-
def get_aftermarket_device(self, token_id:
|
|
242
|
-
check_type("token_id", token_id,
|
|
241
|
+
def get_aftermarket_device(self, token_id: int):
|
|
242
|
+
check_type("token_id", token_id, int)
|
|
243
243
|
url = f"/v1/aftermarket/device/{token_id}"
|
|
244
244
|
self._request("GET", "Devices", url)
|
|
245
245
|
|
|
246
|
-
def get_aftermarket_device_image(self, token_id:
|
|
247
|
-
check_type("token_id", token_id,
|
|
246
|
+
def get_aftermarket_device_image(self, token_id: int):
|
|
247
|
+
check_type("token_id", token_id, int)
|
|
248
248
|
url = f"/v1/aftermarket/device/{token_id}/image"
|
|
249
249
|
self._request("GET", "Devices", url)
|
|
250
250
|
|
|
@@ -7,9 +7,9 @@ class Trips:
|
|
|
7
7
|
self._request = request_method
|
|
8
8
|
self._get_auth_headers = get_auth_headers
|
|
9
9
|
|
|
10
|
-
def trips(self, privilege_token: str, token_id:
|
|
10
|
+
def trips(self, privilege_token: str, token_id: int, page=None) -> dict:
|
|
11
11
|
check_type("privilege_token", privilege_token, str)
|
|
12
|
-
check_type("token_id", token_id,
|
|
12
|
+
check_type("token_id", token_id, int)
|
|
13
13
|
params = {}
|
|
14
14
|
if page is not None:
|
|
15
15
|
params["page"] = [page]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from .api.attestation import Attestation
|
|
1
2
|
from .api.auth import Auth
|
|
2
3
|
from .api.device_data import DeviceData
|
|
3
4
|
from .api.device_definitions import DeviceDefinitions
|
|
@@ -22,6 +23,7 @@ class DIMO:
|
|
|
22
23
|
def __init__(self, env="Production"):
|
|
23
24
|
self.env = env
|
|
24
25
|
self.urls = dimo_environment[env]
|
|
26
|
+
self.attestation = Attestation(self.request, self._get_auth_headers)
|
|
25
27
|
self.auth = Auth(self.request, self._get_auth_headers, self.env)
|
|
26
28
|
self.device_data = DeviceData(self.request, self._get_auth_headers)
|
|
27
29
|
self.device_definitions = DeviceDefinitions(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dimo-python-sdk
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: DIMO SDK in Python
|
|
5
5
|
Author-email: Barrett Kowalsky <barrettkowalsky@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/DIMO-Network/dimo-python-sdk
|
|
@@ -13,7 +13,7 @@ Requires-Python: >=3.8
|
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: requests>=2.30.0
|
|
16
|
-
Requires-Dist:
|
|
16
|
+
Requires-Dist: eth-account==0.13.4
|
|
17
17
|
Requires-Dist: eth-utils==4.1.1
|
|
18
18
|
|
|
19
19
|
# DIMO Python Developer SDK
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dimo-python-sdk"
|
|
7
|
-
version = "0.0
|
|
7
|
+
version = "1.0.0"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Barrett Kowalsky", email="barrettkowalsky@gmail.com" },
|
|
10
10
|
]
|
|
@@ -20,7 +20,7 @@ classifiers = [
|
|
|
20
20
|
|
|
21
21
|
dependencies = [
|
|
22
22
|
"requests>=2.30.0",
|
|
23
|
-
"
|
|
23
|
+
"eth-account==0.13.4",
|
|
24
24
|
"eth-utils==4.1.1",
|
|
25
25
|
]
|
|
26
26
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dimo_python_sdk-0.0.6 → dimo_python_sdk-1.0.0}/dimo_python_sdk.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|