Skip to main content

Home Assistant Python 3 API wrapper for MovingIntelligence

Project description

Python: Moving Intelligence

Basic Python 3 API wrapper for Moving Intelligence asset and fleet management


This package allows you to get get data from

NOTE: You need a login account together with an apikey to be able to use it.


pip3 install pymovingintelligence

Example code

#!/usr/bin/env python3

from pymovingintelligence import MovingIntelligence, InvalidAuthError, InvalidPermissionsError
import logging
import sys
import json
import time

logger = logging.getLogger(__name__)

    ## Init

    # Initialize API client with your login name and apikey
    api = MovingIntelligence(
        username="YOUR USERNAME",
        apikey="YOUR APIKEY",

    ## Misc data
    # Get trip classifications
    classifications = api.get_trip_classifications()

    # Get trip periods
    periods = api.get_trip_periods()

    ## Person data
    # Get all persons
    persons = api.get_persons()

    for person in persons:
        person_id = person["id"]
        name = person["name"]
        # Get trips for person"Get trips for %s", name), 'TODAY', 'UNKNOWN'))"Get detailed trips for %s", name), 'TODAY', 'UNKNOWN'))

    ## Object data
    # Get all objects
    objects = api.get_objects()

    for object in objects:
        object_id = object["id"]
        brand = object["brand"]
        model = object["model"]"Get odometer readings for %s %s", brand, model)"Get trips for %s %s", brand, model), 'TODAY', 'UNKNOWN'))"Get detailed trips for %s %s", brand, model), 'TODAY', 'UNKNOWN'))

except InvalidAuthError:
    logger.debug("Authenticaton error, your username and/or apikey is invalid.")
except InvalidPermissionsError:
    logger.debug("You don't have permission to access this data.")
except (Exception) as err:
    logger.debug("Unknown error occurred. %s", err)

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

pymovingintelligence-0.0.7.tar.gz (5.0 kB view hashes)

Uploaded Source

Supported by

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