dimo-python-sdk 1.7.1__tar.gz → 1.7.2__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-1.7.1 → dimo_python_sdk-1.7.2}/PKG-INFO +2 -2
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/api/__init__.py +2 -0
- dimo_python_sdk-1.7.2/dimo/api/fetch.py +123 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/dimo.py +2 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/environments.py +2 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo_python_sdk.egg-info/PKG-INFO +2 -2
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo_python_sdk.egg-info/SOURCES.txt +1 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/pyproject.toml +2 -1
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/LICENSE +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/README.md +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/__init__.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/api/attestation.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/api/auth.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/api/conversations.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/api/device_definitions.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/api/token_exchange.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/api/trips.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/api/valuations.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/api/vehicle_triggers.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/constants.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/errors.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/eth_signer.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/graphql/__init__.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/graphql/identity.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/graphql/telemetry.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/permission_decoder.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo/request.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo_python_sdk.egg-info/dependency_links.txt +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo_python_sdk.egg-info/requires.txt +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/dimo_python_sdk.egg-info/top_level.txt +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/setup.cfg +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/tests/test_conversations.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/tests/test_dimo.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/tests/test_errors.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/tests/test_permission_decoder.py +0 -0
- {dimo_python_sdk-1.7.1 → dimo_python_sdk-1.7.2}/tests/test_request.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dimo-python-sdk
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.2
|
|
4
4
|
Summary: DIMO SDK in Python
|
|
5
|
-
Author-email: Barrett Kowalsky <barrettkowalsky@gmail.com>
|
|
5
|
+
Author-email: Barrett Kowalsky <barrettkowalsky@gmail.com>, James Li <james.li.upenn@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/DIMO-Network/dimo-python-sdk
|
|
7
7
|
Project-URL: Issues, https://github.com/DIMO-Network/dimo-python-sdk/issues
|
|
8
8
|
Keywords: dimo,sdk,python,depin,web3
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .auth import Auth
|
|
2
2
|
from .attestation import Attestation
|
|
3
3
|
from .device_definitions import DeviceDefinitions
|
|
4
|
+
from .fetch import Fetch
|
|
4
5
|
from .token_exchange import TokenExchange
|
|
5
6
|
from .trips import Trips
|
|
6
7
|
from .valuations import Valuations
|
|
@@ -9,6 +10,7 @@ __all__ = [
|
|
|
9
10
|
"Auth",
|
|
10
11
|
"Attestation",
|
|
11
12
|
"DeviceDefinitions",
|
|
13
|
+
"Fetch",
|
|
12
14
|
"TokenExchange",
|
|
13
15
|
"Trips",
|
|
14
16
|
"Valuations",
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
from dimo.errors import check_type, check_optional_type
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Fetch:
|
|
5
|
+
|
|
6
|
+
def __init__(self, request_method, get_auth_headers):
|
|
7
|
+
self._request = request_method
|
|
8
|
+
self._get_auth_headers = get_auth_headers
|
|
9
|
+
|
|
10
|
+
def _build_params(self, **kwargs):
|
|
11
|
+
params = {}
|
|
12
|
+
for key, value in kwargs.items():
|
|
13
|
+
if value is not None:
|
|
14
|
+
params[key] = value
|
|
15
|
+
return params
|
|
16
|
+
|
|
17
|
+
def get_index_keys(
|
|
18
|
+
self,
|
|
19
|
+
vehicle_jwt: str,
|
|
20
|
+
token_id: int,
|
|
21
|
+
after=None,
|
|
22
|
+
before=None,
|
|
23
|
+
id=None,
|
|
24
|
+
limit=None,
|
|
25
|
+
producer=None,
|
|
26
|
+
source=None,
|
|
27
|
+
type=None,
|
|
28
|
+
) -> dict:
|
|
29
|
+
check_type("vehicle_jwt", vehicle_jwt, str)
|
|
30
|
+
check_type("token_id", token_id, int)
|
|
31
|
+
params = self._build_params(
|
|
32
|
+
after=after, before=before, id=id, limit=limit,
|
|
33
|
+
producer=producer, source=source, type=type,
|
|
34
|
+
)
|
|
35
|
+
url = f"/v1/vehicle/index-keys/{token_id}"
|
|
36
|
+
return self._request(
|
|
37
|
+
"GET",
|
|
38
|
+
"Fetch",
|
|
39
|
+
url,
|
|
40
|
+
params=params,
|
|
41
|
+
headers=self._get_auth_headers(vehicle_jwt),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def get_latest_index_key(
|
|
45
|
+
self,
|
|
46
|
+
vehicle_jwt: str,
|
|
47
|
+
token_id: int,
|
|
48
|
+
after=None,
|
|
49
|
+
before=None,
|
|
50
|
+
id=None,
|
|
51
|
+
limit=None,
|
|
52
|
+
producer=None,
|
|
53
|
+
source=None,
|
|
54
|
+
type=None,
|
|
55
|
+
) -> dict:
|
|
56
|
+
check_type("vehicle_jwt", vehicle_jwt, str)
|
|
57
|
+
check_type("token_id", token_id, int)
|
|
58
|
+
params = self._build_params(
|
|
59
|
+
after=after, before=before, id=id, limit=limit,
|
|
60
|
+
producer=producer, source=source, type=type,
|
|
61
|
+
)
|
|
62
|
+
url = f"/v1/vehicle/latest-index-key/{token_id}"
|
|
63
|
+
return self._request(
|
|
64
|
+
"GET",
|
|
65
|
+
"Fetch",
|
|
66
|
+
url,
|
|
67
|
+
params=params,
|
|
68
|
+
headers=self._get_auth_headers(vehicle_jwt),
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
def get_latest_object(
|
|
72
|
+
self,
|
|
73
|
+
vehicle_jwt: str,
|
|
74
|
+
token_id: int,
|
|
75
|
+
after=None,
|
|
76
|
+
before=None,
|
|
77
|
+
id=None,
|
|
78
|
+
limit=None,
|
|
79
|
+
producer=None,
|
|
80
|
+
source=None,
|
|
81
|
+
type=None,
|
|
82
|
+
) -> dict:
|
|
83
|
+
check_type("vehicle_jwt", vehicle_jwt, str)
|
|
84
|
+
check_type("token_id", token_id, int)
|
|
85
|
+
params = self._build_params(
|
|
86
|
+
after=after, before=before, id=id, limit=limit,
|
|
87
|
+
producer=producer, source=source, type=type,
|
|
88
|
+
)
|
|
89
|
+
url = f"/v1/vehicle/latest-object/{token_id}"
|
|
90
|
+
return self._request(
|
|
91
|
+
"GET",
|
|
92
|
+
"Fetch",
|
|
93
|
+
url,
|
|
94
|
+
params=params,
|
|
95
|
+
headers=self._get_auth_headers(vehicle_jwt),
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
def get_objects(
|
|
99
|
+
self,
|
|
100
|
+
vehicle_jwt: str,
|
|
101
|
+
token_id: int,
|
|
102
|
+
after=None,
|
|
103
|
+
before=None,
|
|
104
|
+
id=None,
|
|
105
|
+
limit=None,
|
|
106
|
+
producer=None,
|
|
107
|
+
source=None,
|
|
108
|
+
type=None,
|
|
109
|
+
) -> dict:
|
|
110
|
+
check_type("vehicle_jwt", vehicle_jwt, str)
|
|
111
|
+
check_type("token_id", token_id, int)
|
|
112
|
+
params = self._build_params(
|
|
113
|
+
after=after, before=before, id=id, limit=limit,
|
|
114
|
+
producer=producer, source=source, type=type,
|
|
115
|
+
)
|
|
116
|
+
url = f"/v1/vehicle/objects/{token_id}"
|
|
117
|
+
return self._request(
|
|
118
|
+
"GET",
|
|
119
|
+
"Fetch",
|
|
120
|
+
url,
|
|
121
|
+
params=params,
|
|
122
|
+
headers=self._get_auth_headers(vehicle_jwt),
|
|
123
|
+
)
|
|
@@ -5,6 +5,7 @@ from .api.auth import Auth
|
|
|
5
5
|
from .api.conversations import Conversations
|
|
6
6
|
from .api.device_definitions import DeviceDefinitions
|
|
7
7
|
from .api.token_exchange import TokenExchange
|
|
8
|
+
from .api.fetch import Fetch
|
|
8
9
|
from .api.trips import Trips
|
|
9
10
|
from .api.valuations import Valuations
|
|
10
11
|
from .api.vehicle_triggers import VehicleTriggers
|
|
@@ -78,6 +79,7 @@ class DIMO:
|
|
|
78
79
|
"auth": (Auth, ("request", "_get_auth_headers", "env", "self")),
|
|
79
80
|
"conversations": (Conversations, ("request", "_get_auth_headers", "_get_full_path", "session")),
|
|
80
81
|
"device_definitions": (DeviceDefinitions, ("request", "_get_auth_headers")),
|
|
82
|
+
"fetch": (Fetch, ("request", "_get_auth_headers")),
|
|
81
83
|
"token_exchange": (
|
|
82
84
|
TokenExchange,
|
|
83
85
|
("request", "_get_auth_headers", "identity", "self"),
|
|
@@ -5,6 +5,7 @@ dimo_environment = {
|
|
|
5
5
|
"Conversations": "https://conversations-api.dimo.zone",
|
|
6
6
|
"Identity": "https://identity-api.dimo.zone/query",
|
|
7
7
|
"DeviceDefinitions": "https://device-definitions-api.dimo.zone",
|
|
8
|
+
"Fetch": "https://fetch-api.dimo.zone",
|
|
8
9
|
"Telemetry": "https://telemetry-api.dimo.zone/query",
|
|
9
10
|
"TokenExchange": "https://token-exchange-api.dimo.zone",
|
|
10
11
|
"Trips": "https://trips-api.dimo.zone",
|
|
@@ -18,6 +19,7 @@ dimo_environment = {
|
|
|
18
19
|
"Conversations": "https://conversations-api.dev.dimo.zone",
|
|
19
20
|
"Identity": "https://identity-api.dev.dimo.zone/query",
|
|
20
21
|
"DeviceDefinitions": "https://device-definitions-api.dev.dimo.zone",
|
|
22
|
+
"Fetch": "https://fetch-api.dev.dimo.zone",
|
|
21
23
|
"Telemetry": "https://telemetry-api.dev.dimo.zone/query",
|
|
22
24
|
"TokenExchange": "https://token-exchange-api.dev.dimo.zone",
|
|
23
25
|
"Trips": "https://trips-api.dev.dimo.zone",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dimo-python-sdk
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.2
|
|
4
4
|
Summary: DIMO SDK in Python
|
|
5
|
-
Author-email: Barrett Kowalsky <barrettkowalsky@gmail.com>
|
|
5
|
+
Author-email: Barrett Kowalsky <barrettkowalsky@gmail.com>, James Li <james.li.upenn@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/DIMO-Network/dimo-python-sdk
|
|
7
7
|
Project-URL: Issues, https://github.com/DIMO-Network/dimo-python-sdk/issues
|
|
8
8
|
Keywords: dimo,sdk,python,depin,web3
|
|
@@ -4,9 +4,10 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dimo-python-sdk"
|
|
7
|
-
version = "1.7.
|
|
7
|
+
version = "1.7.2"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Barrett Kowalsky", email="barrettkowalsky@gmail.com" },
|
|
10
|
+
{ name="James Li", email="james.li.upenn@gmail.com" },
|
|
10
11
|
]
|
|
11
12
|
description = "DIMO SDK in Python"
|
|
12
13
|
readme = "README.md"
|
|
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-1.7.1 → dimo_python_sdk-1.7.2}/dimo_python_sdk.egg-info/dependency_links.txt
RENAMED
|
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
|