Skip to main content

A Python client for the MyGeotab SDK

Project description

Build Status Documentation Code Coverage PyPI Version Python Versions License

A Python client for the MyGeotab SDK.

Features

  • Automatic serializing and deserializing of API call results

  • Clean, Pythonic API for querying data

  • Cross-platform and compatible with Python 3.9+

  • A myg command-line tool for interactively working with data in a terminal

Usage

It’s very easy to get started once you’ve registered a MyGeotab database:

import mygeotab

client = mygeotab.API(username='hello@example.com', password='mypass', database='MyDatabase')
client.authenticate()

devices = client.get('Device', name='%Test Dev%')

print(devices)

# [{'maxSecondsBetweenLogs': 200.0,
#   'activeTo': '2050-01-01',
#   'minAccidentSpeed': 3.0,
#   'ignoreDownloadsUntil': '1986-01-01',
#   'name': 'Test Device',
#   'idleMinutes': 3.0,
#   ......

You can also make calls asynchronously via asyncio:

import asyncio
import mygeotab

client = mygeotab.API(username='hello@example.com', password='mypass', database='MyDatabase')
client.authenticate()

async def get_device():
  return await client.get_async('Device', name='%Test Dev%')

devices = loop.run_until_complete(get_device())
print(devices)

# [{'maxSecondsBetweenLogs': 200.0,
#   'activeTo': '2050-01-01',
#   'minAccidentSpeed': 3.0,
#   'ignoreDownloadsUntil': '1986-01-01',
#   'name': 'Test Device',
#   'idleMinutes': 3.0,
#   ......

Installation

To install the MyGeotab library and command line tool:

$ pip install mygeotab

or for the bleeding-edge version:

$ pip install git+https://github.com/geotab/mygeotab-python

Documentation

Read the docs at http://mygeotab-python.readthedocs.org

Changes

0.9.5 (2026-04-16)

Improvements

  • Altitude: Removed DaasResult wrapper to resurface access check errors directly to the user #192.

0.9.4 (2025-10-24)

Improvements

  • Altitude: Improved error handling for access check failures #133.

  • Removes un-needed pandas and pytest-monkeytype from dev-packages.

0.9.3 (2025-09-08)

Improvements

  • Centralized and better handling of new parameters in API calls (like resultsLimit, search, and propertySelector) #127.

  • Removes deprecated SSL parameters for SSL context creation #125.

0.9.2 (2024-10-08)

Improvements

  • Updates Altitude API call method #124.

0.9.1 (2024-04-05)

Bug Fixes

  • Loads system CA certificates when creating an SSL context #123.

0.9.0 (2024-02-23)

Improvements

  • Removed all Python 2 handling code and packages (six).

  • Simplified code based on removing support for Python 2 and Python 3.6 and lower.

Bug Fixes

  • Support results limit in get requests #11.

  • Handles ArgumentException when extending the session #19.

Housecleaning

  • Changed linter to ruff and enabled additional linters.

  • Ensured proper mypy types installed for 3rd party packages.

0.8.8 (2022-09-14)

Improvements

  • Use the highest TLS version available (at least TLS 1.2) when making calls.

Bug Fixes

  • Fix for recursive hasattr call when serializing objects #7.

0.8.7 (2021-11-11)

Improvements

  • Added support for client-side certificates #1.

  • Console improvements using ptpython (if installed) and better handling of sessions.

0.8.6 (2021-03-15)

Improvements

  • Added new experimental API class (in the mygeotab.ext module) for more intuitive ways of using results from client.get() like get_dataframe() to easily get a Pandas DataFrame from the result set.

  • Adds support for using with proxies #327.

  • Calling authenticate() on an API instance more than once no longer results in an error #328.

Bug Fixes

  • Handle ConnectionError as errors in feed extension rather than crashing #130.

  • Remove extraneous “search” parameter from API.get().

0.8.5 (2019-10-07)

Bug Fixes

  • Fixes issue with warnings from Arrow about date parsing #306.

0.8.4 (2019-08-22)

Bug Fixes

  • Fixes issue with serialization of datetime.date objects #284.

0.8.3 (2019-08-19)

Improvements

  • Use the high-performance python-rapidjson library to serialize and deserialize JSON parameters and responses in Python 3.5+ #268.

Bug Fixes

  • Silence warnings from arrow parsing when the library is used interactively or in a Jupyter notebook.

Housecleaning

  • Added serialization benchmarking in CircleCI tests.

  • Remove PyPy test config.

0.8.2 (2019-06-10)

Bug Fixes

  • Remove asyncio-specific default arguments preventing from importing this pacakge in a Python 3.5+ thread #236.

0.8.1 (2019-06-03)

Improvements

  • Return content with a non-JSON content type as text

Bug Fixes

  • Handle serialization of very old dates #121.

0.8.0 (2018-06-18)

Improvements

  • Python 3.7 support.

  • Raises an exception when request was not successful.

  • Documentation improvements.

Bug Fixes

  • Since all MyGeotab servers enforce the use of TLS1.2, Python 2.7.9 or greater is required.

  • Fix issue where the password was not provided when retrying authentication. Should better handle #92.

0.6.2 (2017-07-04)

Bug Fixes

  • Revert the change to stop compilation in setup.cfg.

0.6.1 (2017-07-03)

Bug Fixes

  • Don’t compile to prevent issues when installing via setup.py on Python 2.7.

0.6.0 (2017-06-29)

Improvements

  • Configurable timeouts when making calls.

  • Removed verify parameter from API objects as SSL is required when calling a MyGeotab server.

  • Removed run command from the CLI.

  • Removed deprecated API.search and API.search_async methods.

  • Refactored setup.py for async API. The async/awaitable methods are now automatically a part of the API object if using Python 3.5 or higher

  • Code linting and cleanup

0.5.4 (2017-06-05)

Bug Fixes

  • Ensure all dates are timezone aware and are always UTC-localized.

0.5.3 (2017-05-30)

Bug Fixes

  • Fixed intermittent timeout errors due to upstream changes in the ‘requests’ module

0.5.2 (2017-02-02)

Bug Fixes

  • Switched back to using abstract dependencies in setup.py (recommended by this guide)

0.5.1 (2017-01-04)

Bug Fixes

  • Fix for search parameter not being properly handled in ‘get()’ call

0.5 (2017-01-02)

Enhancements

  • Deprecated the ‘search()’ and ‘search_async()’ functions. Replaced by folding the previous functionality into ‘run()’.

  • Removed ‘tzlocal’ dependency. Always deal with dates in UTC by default.

  • Prefer functions instead of making static methods in classes.

  • Added helper to run async calls and collect their results

  • Add ability to quickly run simple python scripts from the ‘myg’ console with no need for any authentication handling. Similar to ‘console’, but for running scripts rather than creating an interactive console.

0.4.4 (2016-07-10)

Enhancements

  • Added the ability to make unauthenticated calls (like “GetVersion”) with the static “API.server_call” method

  • Added asyncio-based API query methods (Python 3.5+ only) into the “ext” package

  • Moved the datafeed to the “ext” package, as well

Bug Fixes

  • MyGeotab never returns 3 digits of milliseconds, so follow that format as well to allow the use of “dates.format_iso_datetime” to create MyGeotab URLs

0.4.2 (2016-03-17)

Bug Fixes

  • Use a custom User-Agent when making requests

0.4 (2016-02-25)

Enhancements

  • Extension for facilitating use of the MyGeotab Data Feed

  • Allow Pythonic underscore-separated parameters mapped to camelcase ones

  • Force the use of TLS 1.2 for upcoming strict security requirements in MyGeotab (Note that TLS 1.2 is only supported in Python 2.7.9+ and 3.4+)

Bug Fixes

  • Fixed issue with CLI console startup

  • Use the system’s default user location for config files

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

mygeotab-0.9.5.tar.gz (238.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mygeotab-0.9.5-py2.py3-none-any.whl (30.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mygeotab-0.9.5.tar.gz.

File metadata

  • Download URL: mygeotab-0.9.5.tar.gz
  • Upload date:
  • Size: 238.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mygeotab-0.9.5.tar.gz
Algorithm Hash digest
SHA256 01df1ae6df29737859f13efcb4cb8dc69c9454aee666f02989f7d455a9c5ce62
MD5 483800d5728c68e3868bbdce0bc9f29d
BLAKE2b-256 1424a8eb70694875a72b663d139edb6228a68775ab20345747240e33f7abdc6a

See more details on using hashes here.

File details

Details for the file mygeotab-0.9.5-py2.py3-none-any.whl.

File metadata

  • Download URL: mygeotab-0.9.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 30.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for mygeotab-0.9.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a6f3a3e7ca7818b2b1add2bfc97dd81716d8e6c87a10932691349e7e5d2a256b
MD5 9a0ffc539dc3ce5c0c1f688a8e3ed8aa
BLAKE2b-256 d4ceb5802b7b080d896041ebdcacfe041868d0b2ba5c64605d1fbc464507c01f

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