python-vw-carnet 0.2.0__tar.gz → 0.3.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.
Files changed (31) hide show
  1. python_vw_carnet-0.3.0/PKG-INFO +104 -0
  2. python_vw_carnet-0.3.0/README.md +92 -0
  3. python_vw_carnet-0.3.0/pyproject.toml +27 -0
  4. {python_vw_carnet-0.2.0 → python_vw_carnet-0.3.0/src}/python_vw_carnet/__init__.py +11 -20
  5. {python_vw_carnet-0.2.0 → python_vw_carnet-0.3.0/src}/python_vw_carnet/__main__.py +8 -7
  6. python_vw_carnet-0.3.0/src/python_vw_carnet/client.py +704 -0
  7. python_vw_carnet-0.3.0/src/python_vw_carnet/constants.py +37 -0
  8. python_vw_carnet-0.3.0/src/python_vw_carnet/errors.py +10 -0
  9. python_vw_carnet-0.3.0/src/python_vw_carnet/models/__init__.py +20 -0
  10. python_vw_carnet-0.3.0/src/python_vw_carnet/models/ev_summary.py +130 -0
  11. python_vw_carnet-0.3.0/src/python_vw_carnet/models/garage.py +89 -0
  12. python_vw_carnet-0.3.0/src/python_vw_carnet/models/spin.py +10 -0
  13. python_vw_carnet-0.3.0/src/python_vw_carnet/models/token.py +26 -0
  14. python_vw_carnet-0.3.0/src/python_vw_carnet/models/vehicle.py +83 -0
  15. python_vw_carnet-0.3.0/src/python_vw_carnet/models/vehicle_location.py +23 -0
  16. python_vw_carnet-0.3.0/src/python_vw_carnet/models/vehicle_session.py +66 -0
  17. python_vw_carnet-0.3.0/src/python_vw_carnet/py.typed +0 -0
  18. python_vw_carnet-0.3.0/src/python_vw_carnet/utils.py +16 -0
  19. python_vw_carnet-0.2.0/PKG-INFO +0 -22
  20. python_vw_carnet-0.2.0/README.md +0 -3
  21. python_vw_carnet-0.2.0/pyproject.toml +0 -38
  22. python_vw_carnet-0.2.0/python_vw_carnet/client.py +0 -764
  23. python_vw_carnet-0.2.0/python_vw_carnet/models.py +0 -300
  24. python_vw_carnet-0.2.0/python_vw_carnet/py.typed +0 -1
  25. python_vw_carnet-0.2.0/python_vw_carnet.egg-info/PKG-INFO +0 -22
  26. python_vw_carnet-0.2.0/python_vw_carnet.egg-info/SOURCES.txt +0 -13
  27. python_vw_carnet-0.2.0/python_vw_carnet.egg-info/dependency_links.txt +0 -1
  28. python_vw_carnet-0.2.0/python_vw_carnet.egg-info/entry_points.txt +0 -2
  29. python_vw_carnet-0.2.0/python_vw_carnet.egg-info/requires.txt +0 -1
  30. python_vw_carnet-0.2.0/python_vw_carnet.egg-info/top_level.txt +0 -1
  31. python_vw_carnet-0.2.0/setup.cfg +0 -4
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.3
2
+ Name: python-vw-carnet
3
+ Version: 0.3.0
4
+ Summary: Python client for myVW login, session management, and vehicle data APIs
5
+ Author: dmillerw
6
+ Author-email: dmillerw <dmillerw@gmail.com>
7
+ Requires-Dist: dataclasses-json>=0.6.7
8
+ Requires-Dist: pydantic>=2.12.5
9
+ Requires-Dist: requests>=2.32.5
10
+ Requires-Python: >=3.12
11
+ Description-Content-Type: text/markdown
12
+
13
+ # python_vw_carnet
14
+
15
+ This library aims to provide some amount of interaction with the Volkswagen CarNet API **specific to the US. This will not work in any other country!**
16
+
17
+ This library has **not** been battle tested. It works for me on my machine and that's as far as I've gotten.
18
+
19
+ **I am not responsible for any issues resulting in your use of this library, including but not limited to loss of account access, acts of God, or your car gaining sentience and locking you in the car, forcing you to listen to polka music on repeat.**
20
+
21
+ ## Vehicle Compatibility
22
+
23
+ This library is intended for Volkswagen vehicles in the United States that use the `myVW` application and connected services.
24
+
25
+ Volkswagen's U.S. myVW page says the app is available on most model years 2020 and newer vehicles. The table below is a practical compatibility reference derived from Volkswagen's published U.S. connected-services compatibility charts.
26
+
27
+ ❔ = compatibility is unknown
28
+
29
+ ❌ = no compatibility (mostly because this car doesn't exist in this year)
30
+
31
+ ⚠️ = partial compatibility
32
+
33
+ ✅ = full compatibility
34
+
35
+
36
+ | Model | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 |
37
+ |-------------------|------|------|------|------|------|------|------|
38
+ | Atlas Cross Sport | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
39
+ | Atlas | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
40
+ | Arteon | ❔ | ❔ | ❔ | ❔ | ❌ | ❌ | ❌ |
41
+ | Tiguan | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
42
+ | Passat | ❔ | ❔ | ❔ | ❌ | ❌ | ❌ | ❌ |
43
+ | Jetta | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
44
+ | Jetta GLI | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
45
+ | Taos | ❌ | ❌ | ❔ | ❔ | ❔ | ❔ | |
46
+ | Golf | ❔ | ❔ | ❌ | ❌ | ❌ | ❌ | ❌ |
47
+ | Golf GTI | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
48
+ | Golf R | ❌ | ❌ | ❔ | ❔ | ❔ | ❔ | ❔ |
49
+ | ID.4 | ❌ | ❔ | ❔ | c | ❔ | ❔ | ❌ |
50
+ | ID. Buzz | ❌ | ❌ | ❌ | ❌ | ❌ | ❔ | ❌ |
51
+
52
+ ## Accuracy/Completeness
53
+
54
+ This library is very much a work in progress. As I said it currently suits my needs, but it is not feature complete or accurate in the slightest.
55
+
56
+ I own a 2023 VW ID.4, so I do not have a complete picture of the data available via VWs various APIs.
57
+
58
+ **I am 100% open to contributions to flesh out the library with more features/information. Open an issue or PR and let's talk :)**
59
+
60
+ ## Usage
61
+
62
+ //TODO, kind of...
63
+
64
+ Information on the response types and exactly what data is available can be found in `python_vw_carnet.models`
65
+
66
+ There is a basic CLI for testing at `python_vw_carnet.__main__`
67
+
68
+ ```python
69
+ from python_vw_carnet import VWClient
70
+
71
+ # Instantiate the python_vw_carnet.VWClient class
72
+ client = VWClient(
73
+ email='', # Account email
74
+ password='', # Account password
75
+ spin='', # Account PIN (4 digits)
76
+ session_path='', # Storage path for session persistence (default is $HOME/.vw_client/session.json)
77
+ )
78
+
79
+ # Retrieve Garage
80
+ client.get_garage()
81
+
82
+ # Retrieve Vehicle Information
83
+ client.get_vehicle(vehicle_id='')
84
+
85
+ # Retrieve Vehicle Location
86
+ client.get_vehicle_location(vehicle_id='')
87
+
88
+ # Retrieve EV Status Information
89
+ client.get_ev_summary(vehicle_id='', temp_unit='f')
90
+ ```
91
+
92
+ ## Local Development
93
+
94
+ This project uses `uv` and targets Python 3.12+.
95
+
96
+ ### Set up the environment
97
+
98
+ From the repository root:
99
+
100
+ ```powershell
101
+ uv sync
102
+ ```
103
+
104
+ That will create `.venv` and install both runtime and development dependencies from the project configuration.
@@ -0,0 +1,92 @@
1
+ # python_vw_carnet
2
+
3
+ This library aims to provide some amount of interaction with the Volkswagen CarNet API **specific to the US. This will not work in any other country!**
4
+
5
+ This library has **not** been battle tested. It works for me on my machine and that's as far as I've gotten.
6
+
7
+ **I am not responsible for any issues resulting in your use of this library, including but not limited to loss of account access, acts of God, or your car gaining sentience and locking you in the car, forcing you to listen to polka music on repeat.**
8
+
9
+ ## Vehicle Compatibility
10
+
11
+ This library is intended for Volkswagen vehicles in the United States that use the `myVW` application and connected services.
12
+
13
+ Volkswagen's U.S. myVW page says the app is available on most model years 2020 and newer vehicles. The table below is a practical compatibility reference derived from Volkswagen's published U.S. connected-services compatibility charts.
14
+
15
+ ❔ = compatibility is unknown
16
+
17
+ ❌ = no compatibility (mostly because this car doesn't exist in this year)
18
+
19
+ ⚠️ = partial compatibility
20
+
21
+ ✅ = full compatibility
22
+
23
+
24
+ | Model | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 |
25
+ |-------------------|------|------|------|------|------|------|------|
26
+ | Atlas Cross Sport | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
27
+ | Atlas | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
28
+ | Arteon | ❔ | ❔ | ❔ | ❔ | ❌ | ❌ | ❌ |
29
+ | Tiguan | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
30
+ | Passat | ❔ | ❔ | ❔ | ❌ | ❌ | ❌ | ❌ |
31
+ | Jetta | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
32
+ | Jetta GLI | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
33
+ | Taos | ❌ | ❌ | ❔ | ❔ | ❔ | ❔ | |
34
+ | Golf | ❔ | ❔ | ❌ | ❌ | ❌ | ❌ | ❌ |
35
+ | Golf GTI | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ |
36
+ | Golf R | ❌ | ❌ | ❔ | ❔ | ❔ | ❔ | ❔ |
37
+ | ID.4 | ❌ | ❔ | ❔ | c | ❔ | ❔ | ❌ |
38
+ | ID. Buzz | ❌ | ❌ | ❌ | ❌ | ❌ | ❔ | ❌ |
39
+
40
+ ## Accuracy/Completeness
41
+
42
+ This library is very much a work in progress. As I said it currently suits my needs, but it is not feature complete or accurate in the slightest.
43
+
44
+ I own a 2023 VW ID.4, so I do not have a complete picture of the data available via VWs various APIs.
45
+
46
+ **I am 100% open to contributions to flesh out the library with more features/information. Open an issue or PR and let's talk :)**
47
+
48
+ ## Usage
49
+
50
+ //TODO, kind of...
51
+
52
+ Information on the response types and exactly what data is available can be found in `python_vw_carnet.models`
53
+
54
+ There is a basic CLI for testing at `python_vw_carnet.__main__`
55
+
56
+ ```python
57
+ from python_vw_carnet import VWClient
58
+
59
+ # Instantiate the python_vw_carnet.VWClient class
60
+ client = VWClient(
61
+ email='', # Account email
62
+ password='', # Account password
63
+ spin='', # Account PIN (4 digits)
64
+ session_path='', # Storage path for session persistence (default is $HOME/.vw_client/session.json)
65
+ )
66
+
67
+ # Retrieve Garage
68
+ client.get_garage()
69
+
70
+ # Retrieve Vehicle Information
71
+ client.get_vehicle(vehicle_id='')
72
+
73
+ # Retrieve Vehicle Location
74
+ client.get_vehicle_location(vehicle_id='')
75
+
76
+ # Retrieve EV Status Information
77
+ client.get_ev_summary(vehicle_id='', temp_unit='f')
78
+ ```
79
+
80
+ ## Local Development
81
+
82
+ This project uses `uv` and targets Python 3.12+.
83
+
84
+ ### Set up the environment
85
+
86
+ From the repository root:
87
+
88
+ ```powershell
89
+ uv sync
90
+ ```
91
+
92
+ That will create `.venv` and install both runtime and development dependencies from the project configuration.
@@ -0,0 +1,27 @@
1
+ [project]
2
+ name = "python-vw-carnet"
3
+ version = "0.3.0"
4
+ description = "Python client for myVW login, session management, and vehicle data APIs"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "dmillerw", email = "dmillerw@gmail.com" }
8
+ ]
9
+ requires-python = ">=3.12"
10
+ dependencies = [
11
+ "dataclasses-json>=0.6.7",
12
+ "pydantic>=2.12.5",
13
+ "requests>=2.32.5",
14
+ ]
15
+
16
+ [project.scripts]
17
+ vw-carnet = "python_vw_carnet.__main__:main"
18
+
19
+ [build-system]
20
+ requires = ["uv_build>=0.10.12,<0.11.0"]
21
+ build-backend = "uv_build"
22
+
23
+ [dependency-groups]
24
+ dev = [
25
+ "pre-commit>=4.5.1",
26
+ "ruff>=0.15.7",
27
+ ]
@@ -1,19 +1,15 @@
1
- from .client import VWClient, VWClientError, AuthenticationError, VehicleSessionError, calc_spin_hash
1
+ from .client import VWClient, VWClientError, AuthenticationError, VehicleSessionError
2
2
  from .models import (
3
- EVSummaryRequest,
4
3
  EVSummaryResponse,
5
- GarageRequest,
6
4
  GarageResponse,
7
- RefreshTokenRequest,
8
5
  SpinChallengeResponse,
9
- TokenExchangeRequest,
10
- TokenResponse,
11
- VehicleLocationRequest,
6
+ AccessTokenExchangeRequest,
7
+ RefreshTokenRequest,
8
+ AccessTokenResponse,
9
+ VehicleResponse,
12
10
  VehicleLocationResponse,
13
11
  VehicleSessionRequest,
14
12
  VehicleSessionResponse,
15
- VehicleStatusRequest,
16
- VehicleStatusResponse,
17
13
  )
18
14
 
19
15
  __all__ = [
@@ -21,19 +17,14 @@ __all__ = [
21
17
  "VWClientError",
22
18
  "AuthenticationError",
23
19
  "VehicleSessionError",
24
- "calc_spin_hash",
25
- "TokenExchangeRequest",
26
- "RefreshTokenRequest",
27
- "TokenResponse",
28
- "GarageRequest",
20
+ "EVSummaryResponse",
29
21
  "GarageResponse",
30
22
  "SpinChallengeResponse",
23
+ "AccessTokenExchangeRequest",
24
+ "RefreshTokenRequest",
25
+ "AccessTokenResponse",
26
+ "VehicleResponse",
27
+ "VehicleLocationResponse",
31
28
  "VehicleSessionRequest",
32
29
  "VehicleSessionResponse",
33
- "VehicleStatusRequest",
34
- "VehicleStatusResponse",
35
- "VehicleLocationRequest",
36
- "VehicleLocationResponse",
37
- "EVSummaryRequest",
38
- "EVSummaryResponse",
39
30
  ]
@@ -1,7 +1,4 @@
1
- from __future__ import annotations
2
-
3
1
  import argparse
4
- import json
5
2
  import os
6
3
  import sys
7
4
 
@@ -29,7 +26,9 @@ def main() -> int:
29
26
  args = parser.parse_args()
30
27
 
31
28
  if not args.email or not args.password:
32
- parser.error("email and password are required, either as flags or via VW_EMAIL/VW_PASSWORD")
29
+ parser.error(
30
+ "email and password are required, either as flags or via VW_EMAIL/VW_PASSWORD"
31
+ )
33
32
 
34
33
  client = VWClient(
35
34
  email=args.email,
@@ -42,13 +41,15 @@ def main() -> int:
42
41
  if args.command == "garage":
43
42
  payload = client.get_garage()
44
43
  elif args.command == "status":
45
- payload = client.get_vehicle_status(vehicle_id=args.vehicle_id)
44
+ payload = client.get_vehicle(vehicle_id=args.vehicle_id)
46
45
  elif args.command == "location":
47
46
  payload = client.get_vehicle_location(vehicle_id=args.vehicle_id)
48
47
  else:
49
- payload = client.get_ev_summary(vehicle_id=args.vehicle_id, temp_unit=args.temp_unit)
48
+ payload = client.get_ev_summary(
49
+ vehicle_id=args.vehicle_id, temp_unit=args.temp_unit
50
+ )
50
51
 
51
- json.dump(payload, sys.stdout, indent=2, sort_keys=True)
52
+ sys.stdout.write(payload.model_dump_json(indent=4))
52
53
  sys.stdout.write("\n")
53
54
  return 0
54
55
  finally: