Metadata-Version: 2.2
Name: volvo-connected
Version: 0.1.0
Summary: A Python package for interacting with Volvo Connect API.
Home-page: https://github.com/pyscaffold/pyscaffold/
Author: Stephan van Rooij
Author-email: 1292510+svrooij@users.noreply.github.com
License: The MIT License (MIT)
        
        Copyright (c) 2025 Stephan van Rooij
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Platform: any
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: microsoft-kiota-bundle>=1.6.8
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-mock; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: requests-mock; extra == "dev"
Requires-Dist: requests; extra == "dev"
Requires-Dist: setuptools; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: wheel; extra == "dev"

# Volvo Connected Vehicle API

This is an unofficial Python client for the [Volvo Connected Vehicle API](https://developer.volvocars.com/apis/connected-vehicle/v2/overview/). It is based on the [official API documentation](https://developer.volvocars.com/apis/connected-vehicle/v2/specification/).

![Project generated with PyScaffold](https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold)

Source: [svrooij/py_volvo_connected](https://github.com/svrooij/py_volvo_connected)

## Installation

```bash
pip install volvo-connected
```

## Usage

```python
from kiota_bundle.default_request_adapter import DefaultRequestAdapter
from volvo_connected import (
  StaticAccessTokenProvider,
  VolvoAuthenticationProvider,
  VolvoConnectedClient
)

# Create an access token provider using a static access token
access_token_provider = StaticAccessTokenProvider("YOUR_ACCESS_TOKEN")

# Or explore the DynamicAccessTokenProvider that allows you to auto refresh the token

# Create an authentication provider using your VCC API key and the access token provider
auth_provider = VolvoAuthenticationProvider("YOUR_VCC_API_KEY", access_token_provider)

# Create a request adapter
request_adapter = DefaultRequestAdapter(auth_provider)

# Create a client
client = VolvoConnectedClient(request_adapter)
```

### Get all vehicles

```python
vehicles = await client.vehicles.get()
```

### Get vehicle by VIN

```python
vehicle = await client.vehicles.by_vin("YV4952NA4F120DEMO").get()
```

### Get Fuel or Battery level

```python
fuel_resp = await client.vehicles.by_vin("YV4952NA4F120DEMO").fuel.get()

fuel_resp.data.fuel_amount.value
# or
fuel_resp.data.battery_charge_level.value
```

### All other endpoints

This client is genereted based on the (adjusted) OpenAPI specification. And everything is strong typed, so go ahead and explore the API.
