python-terminusgps 47.1.2__tar.gz → 47.2.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.
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/PKG-INFO +1 -1
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/conf.py +1 -1
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/wialon/index.rst +1 -0
- python_terminusgps-47.2.0/docs/source/wialon/utils.rst +5 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/pyproject.toml +1 -1
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/validators.py +10 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/utils.py +30 -40
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/uv.lock +4 -4
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/.github/workflows/sphinx.yml +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/.gitignore +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/.python-version +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/COPYING +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/README.md +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/Makefile +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/make.bat +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/requirements.txt +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/authorizenet/api.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/authorizenet/constants.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/authorizenet/index.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/authorizenet/service.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/index.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/mixins.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/validators.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/wialon/constants.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/wialon/exceptions.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/wialon/items.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/wialon/session.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/docs/source/wialon/usage.rst +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/__init__.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/__init__.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/api/__init__.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/api/address_profiles.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/api/customer_profiles.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/api/payment_profiles.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/api/subscriptions.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/api/transactions.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/constants.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/service.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/default_settings.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/mixins.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/__init__.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/constants.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/flags.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/__init__.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/account.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/base.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/factory.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/resource.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/retranslator.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/route.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/unit.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/unit_group.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/user.py +0 -0
- {python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/session.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 47.
|
|
3
|
+
Version: 47.2.0
|
|
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.
|
|
15
|
+
release = "47.2.0"
|
|
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.
|
|
3
|
+
version = "47.2.0"
|
|
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" } ]
|
|
@@ -7,6 +7,16 @@ from django.utils.translation import gettext_lazy as _
|
|
|
7
7
|
VALID_COUNTRY_CODES = ("+1", "+52")
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
def validate_is_digit(value: str) -> None:
|
|
11
|
+
"""Raises :py:exc:`django.core.exceptions.ValidationError` if the value contained non-digit characters."""
|
|
12
|
+
if not value.isdigit():
|
|
13
|
+
raise ValidationError(
|
|
14
|
+
_("Value can only contain digits, got '%(value)s'."),
|
|
15
|
+
code="invalid",
|
|
16
|
+
params={"value": value},
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
10
20
|
def validate_e164_phone_number(value: str) -> None:
|
|
11
21
|
"""
|
|
12
22
|
Raises :py:exc:`~django.core.exceptions.ValidationError` if the value is not a valid `E.164 <https://en.wikipedia.org/wiki/E.164>`_ formatted phone number.
|
|
@@ -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(
|
|
@@ -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
|
|
@@ -188,11 +188,11 @@ wheels = [
|
|
|
188
188
|
|
|
189
189
|
[[package]]
|
|
190
190
|
name = "idna"
|
|
191
|
-
version = "3.
|
|
191
|
+
version = "3.11"
|
|
192
192
|
source = { registry = "https://pypi.org/simple" }
|
|
193
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
193
|
+
sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582 }
|
|
194
194
|
wheels = [
|
|
195
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
195
|
+
{ url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008 },
|
|
196
196
|
]
|
|
197
197
|
|
|
198
198
|
[[package]]
|
|
@@ -323,7 +323,7 @@ wheels = [
|
|
|
323
323
|
|
|
324
324
|
[[package]]
|
|
325
325
|
name = "python-terminusgps"
|
|
326
|
-
version = "47.
|
|
326
|
+
version = "47.2.0"
|
|
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.2 → python_terminusgps-47.2.0}/docs/source/authorizenet/constants.rst
RENAMED
|
File without changes
|
|
File without changes
|
{python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/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.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/__init__.py
RENAMED
|
File without changes
|
{python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/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.2 → python_terminusgps-47.2.0}/terminusgps/authorizenet/api/transactions.py
RENAMED
|
File without changes
|
{python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/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
|
{python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/resource.py
RENAMED
|
File without changes
|
{python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/retranslator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-47.1.2 → python_terminusgps-47.2.0}/terminusgps/wialon/items/unit_group.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|