How to use the smartcar.api.Api function in smartcar

To help you get started, we’ve selected a few smartcar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github smartcar / python-sdk / smartcar / vehicle.py View on Github external
def __init__(self, vehicle_id, access_token, unit_system='metric'):
        """ Initializes a new Vehicle to use for making requests to the Smartcar API.

        Args:
            vehicle_id (str): the vehicle's unique identifier
            access_token (str): a valid access token
            unit_system (str, optional): the unit system to use for vehicle data.
                Defaults to metric.

        """
        self.vehicle_id = vehicle_id
        self.access_token = access_token
        self.api = Api(access_token, vehicle_id)
        self.api.set_unit_system(
            'metric' if unit_system == 'metric' else 'imperial')