Skip to main content

A Python package for interacting with Volvo Connect API.

Project description

Volvo Connected Vehicle API

This is an unofficial Python client for the Volvo Connected Vehicle API. It is based on the official API documentation.

Project generated with PyScaffold

Source: svrooij/py_volvo_connected

Installation

pip install volvo-connected

Usage

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

vehicles = await client.vehicles.get()

Get vehicle by VIN

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

Get Fuel or Battery level

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

volvo_connected-0.1.0.tar.gz (54.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

volvo_connected-0.1.0-py3-none-any.whl (97.1 kB view details)

Uploaded Python 3

File details

Details for the file volvo_connected-0.1.0.tar.gz.

File metadata

  • Download URL: volvo_connected-0.1.0.tar.gz
  • Upload date:
  • Size: 54.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for volvo_connected-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8776656df23f79fc26cecc000052574f9a65f45f3b1e9dd85e94527a23cbf466
MD5 70335a34d21b9cf05c7050a21fe15626
BLAKE2b-256 d05dc982fdffb480131370d032c1cfe15f9f20b7d9e84e3409e61337da875767

See more details on using hashes here.

File details

Details for the file volvo_connected-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for volvo_connected-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 867388d72b3e602f424aeceaabd377d07e88eee4b4cad4cca45cebae58c99469
MD5 5295b5d21680d691b2032316a792bce5
BLAKE2b-256 75bd7bde403048d7c04f4a97c40ca05faf8b4351ed1ea7ec9e63a81754df5106

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page