A Python client for the MyGeotab SDK.
- Automatic serialization and deserialization of API call results
- Clean, Pythonic API for querying, adding, updating, and removing entities
- Both synchronous and
async/awaitinterfaces - Cross-platform and compatible with Python 3.10+
mygcommand-line tool for interactively exploring data in a terminal
$ pip install mygeotabFor the latest development version:
$ pip install git+https://github.com/geotab/mygeotab-pythonimport mygeotab
client = mygeotab.API(
username='hello@example.com',
password='mypass',
database='MyDatabase',
)
client.authenticate()
devices = client.get('Device', name='%Test Dev%')
print(devices)
# [{'name': 'Test Device',
# 'maxSecondsBetweenLogs': 200.0,
# 'activeTo': '2050-01-01',
# ...}]import asyncio
import mygeotab
async def main():
client = mygeotab.API(
username='hello@example.com',
password='mypass',
database='MyDatabase',
)
client.authenticate()
devices = await client.get_async('Device', name='%Test Dev%')
print(devices)
asyncio.run(main())The myg tool opens an interactive Python console pre-loaded with an
authenticated API object:
$ myg console MyDatabase
# Inside the console, `myg` is the active API object:
>>> myg.get('Device', name='%Test%')Manage saved sessions:
$ myg sessions --list
$ myg sessions remove MyDatabaseFull API reference and guides are at https://mygeotab-python.readthedocs.io/en/latest/.
Apache 2.0. See LICENSE for details.