python-terminusgps 1.16.0__tar.gz → 1.17.1__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.
Potentially problematic release.
This version of python-terminusgps might be problematic. Click here for more details.
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/PKG-INFO +1 -1
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/pyproject.toml +1 -1
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/__init__.py +1 -0
- python_terminusgps-1.17.1/terminusgps/wialon/items/notification.py +4 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/session.py +0 -13
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/utils.py +23 -11
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/uv.lock +1 -1
- python_terminusgps-1.16.0/terminusgps/wialon/items/notification.py +0 -33
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/.gitignore +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/COPYING +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/README.md +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/__init__.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/__init__.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/auth.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/__init__.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/addresses.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/base.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/customers.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/payments.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/subscriptions.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/aws/__init__.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/aws/secrets.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/aws/ses.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/settings.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/twilio/__init__.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/twilio/caller.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/__init__.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/constants.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/errors.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/flags.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/base.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/resource.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/retranslator.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/route.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/unit.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/unit_group.py +0 -0
- {python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/user.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.17.1
|
|
4
4
|
Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
|
|
5
5
|
Project-URL: Documentation, https://app.terminusgps.com/docs/apps/python-terminusgps/index.html
|
|
6
6
|
Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-terminusgps"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.17.1"
|
|
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" } ]
|
|
@@ -367,16 +367,3 @@ class WialonSessionManager:
|
|
|
367
367
|
if not self._session:
|
|
368
368
|
self._session = WialonSession(sid=sid, log_level=log_level)
|
|
369
369
|
return self._session
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
def main() -> None:
|
|
373
|
-
from terminusgps.wialon.items import WialonUnit
|
|
374
|
-
|
|
375
|
-
with WialonSession(log_level=logging.DEBUG) as session:
|
|
376
|
-
unit = WialonUnit(id="28082258", session=session)
|
|
377
|
-
unit.add_cfield(("to_number", "+17133049421"))
|
|
378
|
-
return
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
if __name__ == "__main__":
|
|
382
|
-
main()
|
|
@@ -91,6 +91,29 @@ def get_wialon_cls(items_type: str) -> typing.Type[WialonBase]:
|
|
|
91
91
|
return wialon_cls
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
def get_vin_info(vin_number: str, session: WialonSession) -> dict:
|
|
95
|
+
"""
|
|
96
|
+
Retrieves vehicle data from a VIN number.
|
|
97
|
+
|
|
98
|
+
:param value: A vehicle's VIN number.
|
|
99
|
+
:type value: :py:obj:`str`
|
|
100
|
+
:param session: A valid Wialon API session.
|
|
101
|
+
:type session: :py:obj:`~terminusgps.wialon.session.WialonSession`
|
|
102
|
+
:returns: A dictionary of vehicle information, if any was found.
|
|
103
|
+
:rtype: :py:obj:`dict`
|
|
104
|
+
|
|
105
|
+
"""
|
|
106
|
+
response = session.wialon_api.unit_get_vin_info(**{"vin": vin_number}).get(
|
|
107
|
+
"vin_lookup_result"
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
{field.get("n"): field.get("v") for field in response.get("pflds")}
|
|
112
|
+
if "error" not in response.keys()
|
|
113
|
+
else {}
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
|
|
94
117
|
def is_unique(value: str, session: WialonSession, items_type: str = "avl_unit") -> bool:
|
|
95
118
|
"""
|
|
96
119
|
Determines if the value is unique among Wialon objects of type 'items_type'.
|
|
@@ -104,7 +127,6 @@ def is_unique(value: str, session: WialonSession, items_type: str = "avl_unit")
|
|
|
104
127
|
:returns: Whether or not the value is unique among 'items_type'.
|
|
105
128
|
:rtype: :py:obj:`bool`
|
|
106
129
|
|
|
107
|
-
|
|
108
130
|
"""
|
|
109
131
|
result = session.wialon_api.core_check_unique(
|
|
110
132
|
**{"type": items_type, "value": value.strip()}
|
|
@@ -173,13 +195,3 @@ def gen_wialon_password(length: int = 32) -> str:
|
|
|
173
195
|
stacklevel=2,
|
|
174
196
|
)
|
|
175
197
|
return generate_wialon_password(length)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
__all__ = [
|
|
179
|
-
"get_hw_type_id",
|
|
180
|
-
"get_id_from_iccid",
|
|
181
|
-
"get_wialon_cls",
|
|
182
|
-
"is_unique",
|
|
183
|
-
"generate_wialon_password",
|
|
184
|
-
"gen_wialon_password",
|
|
185
|
-
]
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
from terminusgps.wialon.items.base import WialonBase
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class WialonNotification(WialonBase):
|
|
5
|
-
def create(
|
|
6
|
-
self,
|
|
7
|
-
resource_id: str | int,
|
|
8
|
-
name: str,
|
|
9
|
-
activation_time: int,
|
|
10
|
-
deactivation_time: int,
|
|
11
|
-
text: str | None = None,
|
|
12
|
-
max_alarms: int = 0,
|
|
13
|
-
interval: int = 0,
|
|
14
|
-
lang: str = "en",
|
|
15
|
-
) -> int | None:
|
|
16
|
-
if isinstance(resource_id, str) and not resource_id.isdigit():
|
|
17
|
-
raise ValueError(f"'resource_id' must be a digit, got '{resource_id}'.")
|
|
18
|
-
|
|
19
|
-
response = self.session.wialon_api.resource_update_notification(
|
|
20
|
-
**{
|
|
21
|
-
"itemId": resource_id,
|
|
22
|
-
"id": 0,
|
|
23
|
-
"callMode": "create",
|
|
24
|
-
"n": name,
|
|
25
|
-
"txt": text if text else name,
|
|
26
|
-
"ta": activation_time,
|
|
27
|
-
"td": deactivation_time,
|
|
28
|
-
"ma": max_alarms,
|
|
29
|
-
"mmtd": interval,
|
|
30
|
-
"la": lang,
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
return int(response[0].get("id")) if response else None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/profiles/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/authorizenet/subscriptions.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/resource.py
RENAMED
|
File without changes
|
{python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/retranslator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-1.16.0 → python_terminusgps-1.17.1}/terminusgps/wialon/items/unit_group.py
RENAMED
|
File without changes
|
|
File without changes
|