autoskope-client 1.3.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.
@@ -0,0 +1,17 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ Copyright 2024 The Autoskope Client Contributors
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
@@ -0,0 +1,24 @@
1
+ Metadata-Version: 2.4
2
+ Name: autoskope_client
3
+ Version: 1.3.1
4
+ Summary: Python client library for the Autoskope API.
5
+ Home-page: https://github.com/mcisk/autoskope_client
6
+ Author: Nico Liebeskind
7
+ Author-email: nico@autoskope.de
8
+ License: Apache-2.0
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: >=3.8
14
+ License-File: LICENSE
15
+ Requires-Dist: aiohttp>=3.8.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: home-page
20
+ Dynamic: license
21
+ Dynamic: license-file
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+ Dynamic: summary
@@ -0,0 +1,137 @@
1
+ # Autoskope Client
2
+
3
+ A Python client library for interacting with the Autoskope vehicle tracking API.
4
+
5
+ ## Features
6
+
7
+ - Async/await support using aiohttp
8
+ - Session management with cookie isolation
9
+ - Context manager support for automatic cleanup
10
+ - Type hints for better IDE support
11
+ - Comprehensive error handling
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install autoskope-client
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ### Basic Usage with Context Manager
22
+
23
+ ```python
24
+ import asyncio
25
+ from autoskope_client import AutoskopeApi
26
+
27
+ async def main():
28
+ async with AutoskopeApi(
29
+ host="https://portal.autoskope.de",
30
+ username="your_username",
31
+ password="your_password"
32
+ ) as api:
33
+ # Get all vehicles
34
+ vehicles = await api.get_vehicles()
35
+
36
+ for vehicle in vehicles:
37
+ print(f"Vehicle: {vehicle.name}")
38
+ if vehicle.position:
39
+ print(f" Location: {vehicle.position.latitude}, {vehicle.position.longitude}")
40
+ print(f" Speed: {vehicle.position.speed} km/h")
41
+
42
+ asyncio.run(main())
43
+ ```
44
+
45
+ ### Manual Session Management
46
+
47
+ ```python
48
+ import asyncio
49
+ from autoskope_client import AutoskopeApi
50
+
51
+ async def main():
52
+ api = AutoskopeApi(
53
+ host="https://portal.autoskope.de",
54
+ username="your_username",
55
+ password="your_password"
56
+ )
57
+
58
+ try:
59
+ await api.connect()
60
+ vehicles = await api.get_vehicles()
61
+
62
+ for vehicle in vehicles:
63
+ print(f"Vehicle: {vehicle.name}")
64
+ finally:
65
+ await api.close()
66
+
67
+ asyncio.run(main())
68
+ ```
69
+
70
+ ### Using with External Session
71
+
72
+ ```python
73
+ import asyncio
74
+ import aiohttp
75
+ from autoskope_client import AutoskopeApi
76
+
77
+ async def main():
78
+ async with aiohttp.ClientSession() as session:
79
+ api = AutoskopeApi(
80
+ host="https://portal.autoskope.de",
81
+ username="your_username",
82
+ password="your_password",
83
+ session=session # Use external session
84
+ )
85
+
86
+ await api.connect()
87
+ vehicles = await api.get_vehicles()
88
+
89
+ asyncio.run(main())
90
+ ```
91
+
92
+ ## Data Models
93
+
94
+ ### Vehicle
95
+ - `id`: Unique identifier
96
+ - `name`: Vehicle name
97
+ - `model`: Vehicle model
98
+ - `battery_voltage`: Battery voltage in volts
99
+ - `external_voltage`: External power voltage in volts
100
+ - `gps_quality`: GPS quality (HDOP - lower is better)
101
+ - `imei`: Device IMEI
102
+ - `position`: Current position (if available)
103
+
104
+ ### VehiclePosition
105
+ - `latitude`: Latitude coordinate
106
+ - `longitude`: Longitude coordinate
107
+ - `speed`: Speed in km/h
108
+ - `timestamp`: Position timestamp
109
+ - `is_parked`: Whether vehicle is parked
110
+
111
+ ## Error Handling
112
+
113
+ The library defines two main exception types:
114
+
115
+ - `InvalidAuth`: Raised when authentication fails
116
+ - `CannotConnect`: Raised when connection to the API fails
117
+
118
+ ```python
119
+ from autoskope_client import AutoskopeApi, InvalidAuth, CannotConnect
120
+
121
+ try:
122
+ async with AutoskopeApi(...) as api:
123
+ vehicles = await api.get_vehicles()
124
+ except InvalidAuth:
125
+ print("Authentication failed. Check credentials.")
126
+ except CannotConnect:
127
+ print("Could not connect to Autoskope API.")
128
+ ```
129
+
130
+ ## Requirements
131
+
132
+ - Python 3.8+
133
+ - aiohttp >= 3.8.0
134
+
135
+ ## Author
136
+
137
+ Nico Liebeskind (nico@autoskope.de)
@@ -0,0 +1,24 @@
1
+ Metadata-Version: 2.4
2
+ Name: autoskope_client
3
+ Version: 1.3.1
4
+ Summary: Python client library for the Autoskope API.
5
+ Home-page: https://github.com/mcisk/autoskope_client
6
+ Author: Nico Liebeskind
7
+ Author-email: nico@autoskope.de
8
+ License: Apache-2.0
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Typing :: Typed
13
+ Requires-Python: >=3.8
14
+ License-File: LICENSE
15
+ Requires-Dist: aiohttp>=3.8.0
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: home-page
20
+ Dynamic: license
21
+ Dynamic: license-file
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+ Dynamic: summary
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ autoskope_client.egg-info/PKG-INFO
6
+ autoskope_client.egg-info/SOURCES.txt
7
+ autoskope_client.egg-info/dependency_links.txt
8
+ autoskope_client.egg-info/requires.txt
9
+ autoskope_client.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ aiohttp>=3.8.0
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel"]
3
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,27 @@
1
+ """Setup script for the Autoskope client library."""
2
+
3
+ from setuptools import find_packages, setup
4
+
5
+ setup(
6
+ name="autoskope_client",
7
+ version="1.3.1",
8
+ description="Python client library for the Autoskope API.",
9
+ author="Nico Liebeskind",
10
+ author_email="nico@autoskope.de",
11
+ url="https://github.com/mcisk/autoskope_client",
12
+ packages=find_packages(),
13
+ package_data={
14
+ "autoskope_client": ["py.typed"],
15
+ },
16
+ install_requires=[
17
+ "aiohttp>=3.8.0",
18
+ ],
19
+ classifiers=[
20
+ "Programming Language :: Python :: 3",
21
+ "License :: OSI Approved :: Apache Software License",
22
+ "Operating System :: OS Independent",
23
+ "Typing :: Typed",
24
+ ],
25
+ python_requires=">=3.8",
26
+ license="Apache-2.0",
27
+ )