autoskope-client 0.1.6__tar.gz → 1.1.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.

Potentially problematic release.


This version of autoskope-client might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autoskope_client
3
- Version: 0.1.6
3
+ Version: 1.1.0
4
4
  Summary: Python client library for the Autoskope API.
5
5
  Home-page: https://github.com/mcisk/autoskope_client
6
6
  Author: Nico Liebeskind
@@ -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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autoskope_client
3
- Version: 0.1.6
3
+ Version: 1.1.0
4
4
  Summary: Python client library for the Autoskope API.
5
5
  Home-page: https://github.com/mcisk/autoskope_client
6
6
  Author: Nico Liebeskind
@@ -1,8 +1,10 @@
1
- from setuptools import setup, find_packages
1
+ """Setup script for the Autoskope client library."""
2
+
3
+ from setuptools import find_packages, setup
2
4
 
3
5
  setup(
4
6
  name="autoskope_client",
5
- version="0.1.6",
7
+ version="1.1.0",
6
8
  description="Python client library for the Autoskope API.",
7
9
  author="Nico Liebeskind",
8
10
  author_email="nico@autoskope.de",
@@ -17,4 +19,4 @@ setup(
17
19
  "Operating System :: OS Independent",
18
20
  ],
19
21
  python_requires=">=3.8",
20
- )
22
+ )
@@ -1,55 +0,0 @@
1
- # autoskope_client
2
-
3
- Python client library for the Autoskope API.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- pip install autoskope-client
9
- ```
10
-
11
- ## Usage
12
-
13
- ```python
14
- import asyncio
15
- from autoskope_client import AutoskopeApi
16
-
17
- async def main():
18
- # Initialize the client
19
- api = AutoskopeApi(
20
- host="https://your-autoskope-host.com",
21
- username="your_username",
22
- password="your_password"
23
- )
24
-
25
- # Authenticate with the API
26
- try:
27
- await api.authenticate()
28
- print("Authentication successful")
29
-
30
- # Get vehicles
31
- vehicles = await api.get_vehicles()
32
- for vehicle in vehicles:
33
- print(f"Vehicle: {vehicle.name}")
34
- print(f"Position: {vehicle.position.latitude}, {vehicle.position.longitude}")
35
- print(f"Speed: {vehicle.position.speed} km/h")
36
- print(f"Park mode: {'Yes' if vehicle.position.park_mode else 'No'}")
37
- print("---")
38
-
39
- except Exception as err:
40
- print(f"Error: {err}")
41
-
42
- # Run the example
43
- if __name__ == "__main__":
44
- asyncio.run(main())
45
- ```
46
-
47
- ## Features
48
-
49
- - Authentication with the Autoskope API
50
- - Retrieve vehicle information
51
- - Get real-time vehicle position data
52
-
53
- ## License
54
-
55
- MIT License