python-terminusgps 47.1.2__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.
Files changed (54) hide show
  1. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/PKG-INFO +1 -1
  2. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/conf.py +1 -1
  3. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/wialon/index.rst +1 -0
  4. python_terminusgps-47.1.3/docs/source/wialon/utils.rst +5 -0
  5. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/pyproject.toml +1 -1
  6. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/utils.py +30 -40
  7. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/uv.lock +1 -1
  8. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/.github/workflows/sphinx.yml +0 -0
  9. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/.gitignore +0 -0
  10. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/.python-version +0 -0
  11. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/COPYING +0 -0
  12. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/README.md +0 -0
  13. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/Makefile +0 -0
  14. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/make.bat +0 -0
  15. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/requirements.txt +0 -0
  16. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/authorizenet/api.rst +0 -0
  17. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/authorizenet/constants.rst +0 -0
  18. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/authorizenet/index.rst +0 -0
  19. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/authorizenet/service.rst +0 -0
  20. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/index.rst +0 -0
  21. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/mixins.rst +0 -0
  22. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/validators.rst +0 -0
  23. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/wialon/constants.rst +0 -0
  24. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/wialon/exceptions.rst +0 -0
  25. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/wialon/items.rst +0 -0
  26. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/wialon/session.rst +0 -0
  27. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/docs/source/wialon/usage.rst +0 -0
  28. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/__init__.py +0 -0
  29. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/authorizenet/__init__.py +0 -0
  30. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/__init__.py +0 -0
  31. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/address_profiles.py +0 -0
  32. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/customer_profiles.py +0 -0
  33. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/payment_profiles.py +0 -0
  34. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/subscriptions.py +0 -0
  35. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/authorizenet/api/transactions.py +0 -0
  36. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/authorizenet/constants.py +0 -0
  37. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/authorizenet/service.py +0 -0
  38. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/default_settings.py +0 -0
  39. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/mixins.py +0 -0
  40. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/validators.py +0 -0
  41. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/__init__.py +0 -0
  42. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/constants.py +0 -0
  43. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/flags.py +0 -0
  44. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/items/__init__.py +0 -0
  45. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/items/account.py +0 -0
  46. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/items/base.py +0 -0
  47. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/items/factory.py +0 -0
  48. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/items/resource.py +0 -0
  49. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/items/retranslator.py +0 -0
  50. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/items/route.py +0 -0
  51. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/items/unit.py +0 -0
  52. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/items/unit_group.py +0 -0
  53. {python_terminusgps-47.1.2 → python_terminusgps-47.1.3}/terminusgps/wialon/items/user.py +0 -0
  54. {python_terminusgps-47.1.2 → 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.2
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.2"
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
@@ -13,3 +13,4 @@ Most Wialon objects are modeled as plain Python classes which have methods that
13
13
  items.rst
14
14
  session.rst
15
15
  usage.rst
16
+ utils.rst
@@ -0,0 +1,5 @@
1
+ Utilities
2
+ =========
3
+
4
+ .. automodule:: terminusgps.wialon.utils
5
+ :members:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-terminusgps"
3
- version = "47.1.2"
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: :py:obj:`~terminusgps.wialon.session.WialonSession`
17
+ :type session: ~terminusgps.wialon.session.WialonSession
18
18
  :returns: A list of hardware types.
19
- :rtype: :py:obj:`list`
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: :py:obj:`str`
40
+ :type name: str
41
41
  :param session: A valid Wialon API session.
42
- :type session: :py:obj:`~terminusgps.wialon.session.WialonSession`
42
+ :type session: ~terminusgps.wialon.session.WialonSession
43
43
  :returns: A Wialon user.
44
- :rtype: :py:obj:`~terminusgps.wialon.items.user.WialonUser` | :py:obj:`None`
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: :py:obj:`~terminusgps.wialon.session.WialonSession`
77
+ :type session: ~terminusgps.wialon.session.WialonSession
78
78
  :returns: A list of telecommunication carrier company names.
79
- :rtype: :py:obj:`list`
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: A telecommunications carrier company name, e.g. ``"US Cell"`` or ``"Conetixx"``.
114
- :type carrier_name: :py:obj:`str`
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: :py:obj:`~terminusgps.wialon.session.WialonSession`
117
- :returns: A list of units, if any were found.
118
- :rtype: :py:obj:`list`
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: :py:obj:`str`
153
+ :type iccid: str
154
154
  :param session: A valid Wialon API session.
155
- :type session: :py:obj:`~terminusgps.wialon.session.WialonSession`
155
+ :type session: ~terminusgps.wialon.session.WialonSession
156
156
  :returns: The Wialon unit.
157
- :rtype: :py:obj:`~terminusgps.wialon.items.WialonUnit`
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: :py:obj:`str`
194
+ :type imei: str
195
195
  :param session: A valid Wialon API session.
196
- :type session: :py:obj:`~terminusgps.wialon.session.WialonSession`
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: :py:obj:`str` | :py:obj:`None`
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 value: A vehicle's VIN number.
237
- :type value: :py:obj:`str`
234
+ :param vin: A vehicle VIN #.
235
+ :type vin: str
238
236
  :param session: A valid Wialon API session.
239
- :type session: :py:obj:`~terminusgps.wialon.session.WialonSession`
237
+ :type session: ~terminusgps.wialon.session.WialonSession
240
238
  :returns: A dictionary of vehicle information, if any was found.
241
- :rtype: :py:obj:`dict`
239
+ :rtype: dict[str, ~typing.Any]
242
240
 
243
241
  """
244
- response = session.wialon_api.unit_get_vin_info(**{"vin": vin_number})
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 :py:obj:`32`.
271
- :type length: :py:obj:`int`
272
- :raises ValueError: If ``length`` is less than ``8`` or greater than ``64``.
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: :py:obj:`str`
264
+ :rtype: str
275
265
 
276
266
  """
277
267
  min_length, max_length = 8, 64
@@ -323,7 +323,7 @@ wheels = [
323
323
 
324
324
  [[package]]
325
325
  name = "python-terminusgps"
326
- version = "47.1.2"
326
+ version = "47.1.3"
327
327
  source = { editable = "." }
328
328
  dependencies = [
329
329
  { name = "authorizenet" },