Python client for the Volvo Cars API.
Project description
Volvo Cars API
This python library lets you use the Volvo Cars API. Authorisation follows the OAuth 2.0 authorisation code flow with PKCE.
Requirements
You'll need a Volvo Developers account and create an API application. Make sure to fill in all required fields and write down the retrieved client id and secret.
Usage
A script is worth a thousand words.
# Retrieved at the end of the API application registration process
client_id = "abc"
client_secret = "very-secret-key"
# Scopes that have been requested during the API application registration. You can also
# use less scopes than requested.
scopes = [
"openid",
"conve:battery_charge_level",
"conve:brake_status",
"conve:climatization_start_stop",
"conve:command_accessibility",
"conve:commands",
"conve:diagnostics_engine_status",
# ...
]
# Must be excactly as entered during the API application registration
redirect_uri = "htttps://my-volvo-application.io/callback"
# The VCC API key retrieved after the API application registration process
api_key = "abcdef-1234567890-abcdef"
client_session = _get_client_session()
# Authenticate
auth = VolvoCarsAuth(
client_session,
client_id=client_id,
client_secret=client_secret,
scopes=scopes,
redirect_uri=redirect_uri)
auth_uri = await auth.get_auth_uri() # optionally pass state
# Redirect user to auth_uri and wait for the callback
# ...
# Extract code from the callback url
code = _get_code_from_url()
await auth.async_request_token(code)
# The VIN must be linked to the account you sign in with
vin = "YV123456789012345"
# Create API client
api = VolvoCarsApi(client_session, auth, api_key, vin)
# Make API request
engine_warnings = await api.async_get_engine_warnings()
🚗 Powered by dreams
If you'd like to show your appreciation for this project, feel free to toss a coin to your dev. Donations help keep things running — and who knows, maybe one day they'll add up to a Volvo EX90 (hey, let me dream!). If you're feeling generous, you may donate one too — I'll even come pick it up! 😁
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file volvocarsapi-0.4.2.tar.gz.
File metadata
- Download URL: volvocarsapi-0.4.2.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f20310455a97dd0e51b59c61addd6d802964e1fcd4918a8753df3bb3b53b25f
|
|
| MD5 |
ef0fdff758644aca96c0d327745bf84e
|
|
| BLAKE2b-256 |
9e4fa68a18a9dd60569b253dff47ac1b58e992af1b94056a72462167dfcb755a
|
Provenance
The following attestation bundles were made for volvocarsapi-0.4.2.tar.gz:
Publisher:
publish.yml on thomasddn/volvo-cars-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
volvocarsapi-0.4.2.tar.gz -
Subject digest:
2f20310455a97dd0e51b59c61addd6d802964e1fcd4918a8753df3bb3b53b25f - Sigstore transparency entry: 459259250
- Sigstore integration time:
-
Permalink:
thomasddn/volvo-cars-api@42bb8f0d9524bdc62433f79b17067efec5538482 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/thomasddn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@42bb8f0d9524bdc62433f79b17067efec5538482 -
Trigger Event:
release
-
Statement type:
File details
Details for the file volvocarsapi-0.4.2-py3-none-any.whl.
File metadata
- Download URL: volvocarsapi-0.4.2-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5ed99c7df6a6c94d909efcc106491cc06b1be62b1c20f04cc3fe40206f197fa
|
|
| MD5 |
866a0302bd0ead68a92cdf6cdd16153e
|
|
| BLAKE2b-256 |
4f808bc9e63c0c0202c2799c8951777864fe5726686bebb2dc4ada0d56e81fc6
|
Provenance
The following attestation bundles were made for volvocarsapi-0.4.2-py3-none-any.whl:
Publisher:
publish.yml on thomasddn/volvo-cars-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
volvocarsapi-0.4.2-py3-none-any.whl -
Subject digest:
f5ed99c7df6a6c94d909efcc106491cc06b1be62b1c20f04cc3fe40206f197fa - Sigstore transparency entry: 459259273
- Sigstore integration time:
-
Permalink:
thomasddn/volvo-cars-api@42bb8f0d9524bdc62433f79b17067efec5538482 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/thomasddn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@42bb8f0d9524bdc62433f79b17067efec5538482 -
Trigger Event:
release
-
Statement type: