python-terminusgps 47.1.1__tar.gz → 47.1.3__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.
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/PKG-INFO +1 -1
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/conf.py +1 -1
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/wialon/index.rst +1 -0
- python_terminusgps-47.1.3/docs/source/wialon/utils.rst +5 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/pyproject.toml +1 -1
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/utils.py +31 -41
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/uv.lock +7 -7
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/.github/workflows/sphinx.yml +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/.gitignore +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/.python-version +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/COPYING +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/README.md +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/Makefile +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/make.bat +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/requirements.txt +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/authorizenet/api.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/authorizenet/constants.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/authorizenet/index.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/authorizenet/service.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/index.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/mixins.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/validators.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/wialon/constants.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/wialon/exceptions.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/wialon/items.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/wialon/session.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/wialon/usage.rst +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/__init__.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/__init__.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/__init__.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/address_profiles.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/customer_profiles.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/payment_profiles.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/subscriptions.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/transactions.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/constants.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/service.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/default_settings.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/mixins.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/validators.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/__init__.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/constants.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/flags.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/__init__.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/account.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/base.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/factory.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/resource.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/retranslator.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/route.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/unit.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/unit_group.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/user.py +0 -0
- {python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/session.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 47.1.
|
|
3
|
+
Version: 47.1.3
|
|
4
4
|
Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
|
|
5
5
|
Project-URL: Documentation, https://terminusgps.github.io/python-terminusgps
|
|
6
6
|
Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
|
|
@@ -12,7 +12,7 @@ sys.path.insert(0, os.path.abspath("../../"))
|
|
|
12
12
|
project = "python-terminusgps"
|
|
13
13
|
copyright = "2025, Terminus GPS, LLC"
|
|
14
14
|
author = "Terminus GPS, LLC"
|
|
15
|
-
release = "47.1.
|
|
15
|
+
release = "47.1.3"
|
|
16
16
|
|
|
17
17
|
# -- General configuration ---------------------------------------------------
|
|
18
18
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-terminusgps"
|
|
3
|
-
version = "47.1.
|
|
3
|
+
version = "47.1.3"
|
|
4
4
|
description = "Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [ {name = "Blake Nall", email = "blake@terminusgps.com" } ]
|
|
@@ -14,9 +14,9 @@ def get_hw_types(session: WialonSession) -> list[dict[str, str | int]]:
|
|
|
14
14
|
Returns a list of hardware type objects for Wialon.
|
|
15
15
|
|
|
16
16
|
:param session: A valid Wialon API session.
|
|
17
|
-
:type session:
|
|
17
|
+
:type session: ~terminusgps.wialon.session.WialonSession
|
|
18
18
|
:returns: A list of hardware types.
|
|
19
|
-
:rtype:
|
|
19
|
+
:rtype: list[dict[str, str | int]]
|
|
20
20
|
|
|
21
21
|
Hardware type format:
|
|
22
22
|
|
|
@@ -37,11 +37,11 @@ def get_user_by_name(name: str, session: WialonSession) -> WialonUser:
|
|
|
37
37
|
Returns a Wialon user by name.
|
|
38
38
|
|
|
39
39
|
:param name: A Wialon user name.
|
|
40
|
-
:type name:
|
|
40
|
+
:type name: str
|
|
41
41
|
:param session: A valid Wialon API session.
|
|
42
|
-
:type session:
|
|
42
|
+
:type session: ~terminusgps.wialon.session.WialonSession
|
|
43
43
|
:returns: A Wialon user.
|
|
44
|
-
:rtype:
|
|
44
|
+
:rtype: ~terminusgps.wialon.items.user.WialonUser | None
|
|
45
45
|
|
|
46
46
|
"""
|
|
47
47
|
response = session.wialon_api.core_search_items(
|
|
@@ -74,9 +74,9 @@ def get_carrier_names(session: WialonSession) -> list[str]:
|
|
|
74
74
|
Returns a list of all telecommunication carrier company names present in Wialon.
|
|
75
75
|
|
|
76
76
|
:param session: A valid Wialon API session.
|
|
77
|
-
:type session:
|
|
77
|
+
:type session: ~terminusgps.wialon.session.WialonSession
|
|
78
78
|
:returns: A list of telecommunication carrier company names.
|
|
79
|
-
:rtype:
|
|
79
|
+
:rtype: list[str]
|
|
80
80
|
|
|
81
81
|
"""
|
|
82
82
|
response = session.wialon_api.core_search_items(
|
|
@@ -96,7 +96,7 @@ def get_carrier_names(session: WialonSession) -> list[str]:
|
|
|
96
96
|
}
|
|
97
97
|
)
|
|
98
98
|
carrier_names: list[str] = [
|
|
99
|
-
field["v"]
|
|
99
|
+
str(field["v"]).lower()
|
|
100
100
|
for item in response.get("items", [{}])
|
|
101
101
|
for field in item.get("aflds", {}).values()
|
|
102
102
|
if field["n"] == "carrier" and field["v"]
|
|
@@ -110,12 +110,12 @@ def get_units_by_carrier(
|
|
|
110
110
|
"""
|
|
111
111
|
Returns a list of all units by telecommunications carrier company name.
|
|
112
112
|
|
|
113
|
-
:param carrier_name:
|
|
114
|
-
:type carrier_name:
|
|
113
|
+
:param carrier_name: Case-insensitive telecommunications carrier company name, e.g. ``"UScell"`` or ``"Conetixx"``.
|
|
114
|
+
:type carrier_name: str
|
|
115
115
|
:param session: A valid Wialon API session.
|
|
116
|
-
:type session:
|
|
117
|
-
:returns: A list of units
|
|
118
|
-
:rtype:
|
|
116
|
+
:type session: ~terminusgps.wialon.session.WialonSession
|
|
117
|
+
:returns: A list of units.
|
|
118
|
+
:rtype: list[~terminusgps.wialon.items.unit.WialonUnit]
|
|
119
119
|
|
|
120
120
|
"""
|
|
121
121
|
response = session.wialon_api.core_search_items(
|
|
@@ -123,7 +123,7 @@ def get_units_by_carrier(
|
|
|
123
123
|
"spec": {
|
|
124
124
|
"itemsType": "avl_unit",
|
|
125
125
|
"propName": "admin_fields,rel_adminfield_value",
|
|
126
|
-
"propValueMask": f"carrier,{carrier_name}",
|
|
126
|
+
"propValueMask": f"carrier,{carrier_name.lower()}",
|
|
127
127
|
"sortType": "admin_fields,admin_fields",
|
|
128
128
|
"propType": "propitemname",
|
|
129
129
|
},
|
|
@@ -137,7 +137,7 @@ def get_units_by_carrier(
|
|
|
137
137
|
num_items: int = int(response.get("totalItemsCount"))
|
|
138
138
|
if num_items <= 0:
|
|
139
139
|
raise ValueError(
|
|
140
|
-
f"Couldn't find any units by carrier '{carrier_name}'."
|
|
140
|
+
f"Couldn't find any units by carrier '{carrier_name.lower()}'."
|
|
141
141
|
)
|
|
142
142
|
|
|
143
143
|
factory = WialonObjectFactory(session)
|
|
@@ -150,11 +150,11 @@ def get_unit_by_iccid(iccid: str, session: WialonSession) -> WialonUnit:
|
|
|
150
150
|
Returns a unit by iccid (SIM card #).
|
|
151
151
|
|
|
152
152
|
:param iccid: A SIM card #.
|
|
153
|
-
:type iccid:
|
|
153
|
+
:type iccid: str
|
|
154
154
|
:param session: A valid Wialon API session.
|
|
155
|
-
:type session:
|
|
155
|
+
:type session: ~terminusgps.wialon.session.WialonSession
|
|
156
156
|
:returns: The Wialon unit.
|
|
157
|
-
:rtype:
|
|
157
|
+
:rtype: ~terminusgps.wialon.items.WialonUnit
|
|
158
158
|
|
|
159
159
|
"""
|
|
160
160
|
response = session.wialon_api.core_search_items(
|
|
@@ -191,13 +191,13 @@ def get_unit_by_imei(
|
|
|
191
191
|
Takes a Wialon unit's IMEI # and returns its unit id.
|
|
192
192
|
|
|
193
193
|
:param imei: A Wialon unit's IMEI #.
|
|
194
|
-
:type imei:
|
|
194
|
+
:type imei: str
|
|
195
195
|
:param session: A valid Wialon API session.
|
|
196
|
-
:type session:
|
|
196
|
+
:type session: ~terminusgps.wialon.session.WialonSession
|
|
197
197
|
:raises ValueError: If ``imei`` wasn't a digit.
|
|
198
198
|
:raises WialonAPIError: If something went wrong calling the Wialon API.
|
|
199
199
|
:returns: A Wialon unit, if it was found.
|
|
200
|
-
:rtype:
|
|
200
|
+
:rtype: ~terminusgps.wialon.items.unit.WialonUnit | None
|
|
201
201
|
|
|
202
202
|
"""
|
|
203
203
|
if isinstance(imei, str) and not imei.isdigit():
|
|
@@ -227,35 +227,25 @@ def get_unit_by_imei(
|
|
|
227
227
|
return factory.get("avl_unit", id=int(response.get("items")[0].get("id")))
|
|
228
228
|
|
|
229
229
|
|
|
230
|
-
def get_vin_info(
|
|
231
|
-
vin_number: str, session: WialonSession
|
|
232
|
-
) -> dict[str, typing.Any]:
|
|
230
|
+
def get_vin_info(vin: str, session: WialonSession) -> dict[str, typing.Any]:
|
|
233
231
|
"""
|
|
234
232
|
Retrieves vehicle data from a VIN number.
|
|
235
233
|
|
|
236
|
-
:param
|
|
237
|
-
:type
|
|
234
|
+
:param vin: A vehicle VIN #.
|
|
235
|
+
:type vin: str
|
|
238
236
|
:param session: A valid Wialon API session.
|
|
239
|
-
:type session:
|
|
237
|
+
:type session: ~terminusgps.wialon.session.WialonSession
|
|
240
238
|
:returns: A dictionary of vehicle information, if any was found.
|
|
241
|
-
:rtype:
|
|
239
|
+
:rtype: dict[str, ~typing.Any]
|
|
242
240
|
|
|
243
241
|
"""
|
|
244
|
-
response = session.wialon_api.unit_get_vin_info(**{"vin":
|
|
242
|
+
response = session.wialon_api.unit_get_vin_info(**{"vin": vin})
|
|
245
243
|
results = response.get("vin_lookup_result", {})
|
|
246
244
|
if "error" in results.keys():
|
|
247
245
|
return {}
|
|
248
246
|
return {field.get("n"): field.get("v") for field in results.get("pflds")}
|
|
249
247
|
|
|
250
248
|
|
|
251
|
-
def check_unique(object_type: str, name: str, session: WialonSession) -> bool:
|
|
252
|
-
return bool(
|
|
253
|
-
session.wialon_api.core_check_unique(
|
|
254
|
-
**{"type": object_type, "value": name}
|
|
255
|
-
).get("result")
|
|
256
|
-
)
|
|
257
|
-
|
|
258
|
-
|
|
259
249
|
def generate_wialon_password(length: int = 32) -> str:
|
|
260
250
|
"""
|
|
261
251
|
Generates a Wialon compliant password between ``8`` and ``64`` characters.
|
|
@@ -267,11 +257,11 @@ def generate_wialon_password(length: int = 32) -> str:
|
|
|
267
257
|
- At least one special symbol.
|
|
268
258
|
- At least three digits.
|
|
269
259
|
|
|
270
|
-
:param length: Length of the generated password. Default is
|
|
271
|
-
:type length:
|
|
272
|
-
:raises ValueError: If ``length``
|
|
260
|
+
:param length: Length of the generated password. Default is ``32``.
|
|
261
|
+
:type length: int
|
|
262
|
+
:raises ValueError: If ``length`` was less than ``8`` or greater than ``64``.
|
|
273
263
|
:returns: A Wialon compliant password.
|
|
274
|
-
:rtype:
|
|
264
|
+
:rtype: str
|
|
275
265
|
|
|
276
266
|
"""
|
|
277
267
|
min_length, max_length = 8, 64
|
|
@@ -142,7 +142,7 @@ wheels = [
|
|
|
142
142
|
|
|
143
143
|
[[package]]
|
|
144
144
|
name = "django-stubs"
|
|
145
|
-
version = "5.2.
|
|
145
|
+
version = "5.2.7"
|
|
146
146
|
source = { registry = "https://pypi.org/simple" }
|
|
147
147
|
dependencies = [
|
|
148
148
|
{ name = "django" },
|
|
@@ -150,22 +150,22 @@ dependencies = [
|
|
|
150
150
|
{ name = "types-pyyaml" },
|
|
151
151
|
{ name = "typing-extensions" },
|
|
152
152
|
]
|
|
153
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
153
|
+
sdist = { url = "https://files.pythonhosted.org/packages/5d/a8/bc8c55212978f1e666486b60a4bfb0bc3a066de8212fa7389ff0f3dca639/django_stubs-5.2.7.tar.gz", hash = "sha256:2a07e47a8a867836a763c6bba8bf3775847b4fd9555bfa940360e32d0ee384a1", size = 257339 }
|
|
154
154
|
wheels = [
|
|
155
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
155
|
+
{ url = "https://files.pythonhosted.org/packages/ad/66/1c8063eee88a943f01d073dbbbda34ed093bf6e19738178506a66abbd5ad/django_stubs-5.2.7-py3-none-any.whl", hash = "sha256:2864e74b56ead866ff1365a051f24d852f6ed02238959664f558a6c9601c95bf", size = 507733 },
|
|
156
156
|
]
|
|
157
157
|
|
|
158
158
|
[[package]]
|
|
159
159
|
name = "django-stubs-ext"
|
|
160
|
-
version = "5.2.
|
|
160
|
+
version = "5.2.7"
|
|
161
161
|
source = { registry = "https://pypi.org/simple" }
|
|
162
162
|
dependencies = [
|
|
163
163
|
{ name = "django" },
|
|
164
164
|
{ name = "typing-extensions" },
|
|
165
165
|
]
|
|
166
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
166
|
+
sdist = { url = "https://files.pythonhosted.org/packages/9b/6f/a0bab0e6a7676ab3ca02d51b459444e9bd6dd747e3a43b9c24cae6d0a1c6/django_stubs_ext-5.2.7.tar.gz", hash = "sha256:b690655bd4cb8a44ae57abb314e0995dc90414280db8f26fff0cb9fb367d1cac", size = 6524 }
|
|
167
167
|
wheels = [
|
|
168
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
168
|
+
{ url = "https://files.pythonhosted.org/packages/f8/c9/60445606e26706d3fccadf3b80ee1a9f32c1012683ff2ada7580937b2da9/django_stubs_ext-5.2.7-py3-none-any.whl", hash = "sha256:0466a7132587d49c5bbe12082ac9824d117a0dedcad5d0ada75a6e0d3aca6f60", size = 9979 },
|
|
169
169
|
]
|
|
170
170
|
|
|
171
171
|
[[package]]
|
|
@@ -323,7 +323,7 @@ wheels = [
|
|
|
323
323
|
|
|
324
324
|
[[package]]
|
|
325
325
|
name = "python-terminusgps"
|
|
326
|
-
version = "47.1.
|
|
326
|
+
version = "47.1.3"
|
|
327
327
|
source = { editable = "." }
|
|
328
328
|
dependencies = [
|
|
329
329
|
{ name = "authorizenet" },
|
|
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
|
{python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/authorizenet/constants.rst
RENAMED
|
File without changes
|
|
File without changes
|
{python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/docs/source/authorizenet/service.rst
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
|
|
File without changes
|
{python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/__init__.py
RENAMED
|
File without changes
|
{python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/transactions.py
RENAMED
|
File without changes
|
{python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/authorizenet/constants.py
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
|
{python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/resource.py
RENAMED
|
File without changes
|
{python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/retranslator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-47.1.1 → python_terminusgps-47.1.3}/terminusgps/wialon/items/unit_group.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|