An Apache2 Licensed, unofficial Python client for the MyGeotab SDK.
Also bundled is the "myg" command line tool, which is a sandboxed console for quickly querying and operating on MyGeotab data.
- Automatic serializing and de-serializing of JSON results
- Clean, Pythonic API for querying data
- Cross-platform and compatible with Python 2.7.9+, 3.4+, and pypy 4+
It's very easy to get started once you've registered with MyGeotab:
import mygeotab
client = mygeotab.API(username='[email protected]', 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,
# ......
If you're using Python 3.5 and higher, you can also make calls asynchronously via asyncio:
import asyncio
import mygeotab
client = mygeotab.API(username='[email protected]', 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,
# ......
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
Read the docs at http://mygeotab-python.readthedocs.org