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.1.tar.gz (55.4 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.1-py3-none-any.whl (97.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: volvo_connected-0.1.1.tar.gz
  • Upload date:
  • Size: 55.4 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.1.tar.gz
Algorithm Hash digest
SHA256 e8dbca119f96bc9a51740c7a29046aedddb74fdf1703bc407f51c41a1649fa7f
MD5 c956fd633034b6d35b3be4dd1aa3e9ff
BLAKE2b-256 884daab91c7ac46eb38cddc3312391d6e2703748b6c4e011660ed4a8e4f9a9d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for volvo_connected-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d5be297461962b333b421f7594d25fbd547701be31ce1afefb6d03fd9344832
MD5 efaa2311dc44c883d8aa1bc9ece24844
BLAKE2b-256 427eaca98603df10dbaaac70c53b46705772808bfb89f3c6e040d7d20a65500a

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