Python: Data SDK
Fetch vehicle data using the Python Data SDK
Last updated
Fetch vehicle data using the Python Data SDK
Last updated
Similar to the Data SDK in TypeScript, we also offer a Data SDK written in Python. The Python SDK is an open-source SDK built to facilitate developers in connecting to the API Services. The objective of the Python Data SDK is to handle actions that interact with the DIMO APIs.
To get started with the Python Data SDK, you should always start by defining which API your application is interested in using. Depending on what you want access to, you may need the following:
developer_jwt
: This uses the Developer License public credentials and the private key (API Key) of the app. A developer would get this JWT on the backend through Auth. This is sometimes referred to as access_token.
vehicle_jwt:
This is the second layer of security around getting vehicle data. A developer would first need end users to grand permissions to the Developer License, and then get this JWT through Token Exchange. This is sometimes referred to as privilege_token
.
To learn more about the different JWTs and what they mean, visit the JWT section in Authentication.
Import the SDK:
Initiate the SDK depending on the environment of your interest, we currently support both Production
and Dev
environments:
Before you can get privileged data for vehicles via the Vehicle JWT, a user must have already shared vehicles with you (via your developer license). For more information on how to allow users to share their vehicle data with you, navigate to Login with DIMO.
Use the client_id
, domain
(aka redirectUri
), and api_key
from your application that you configured in the Developer Console.
Your developer_jwt
will be the dev_jwt
from the previous section, for Getting a Developer JWT.
The privileges
should be in list format – the below is just an example of privileges. You can read more about privileges under SACD Permissions Contract.
The token_id
is the token_id of the vehicle you'll be requesting data for, e.g. getting Telemetry data.