Skip to content

Repository files navigation

MyGeotab

Build StatusDocumentationCode CoveragePyPI VersionPython VersionsLicense

A Python client for the MyGeotab SDK.

Features

  • Automatic serialization and deserialization of API call results
  • Clean, Pythonic API for querying, adding, updating, and removing entities
  • Both synchronous and async/await interfaces
  • Cross-platform and compatible with Python 3.10+
  • myg command-line tool for interactively exploring data in a terminal

Installation

$ pip install mygeotab

For the latest development version:

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

Usage

Synchronous

importmygeotabclient=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',# ...}]

Asynchronous

importasyncioimportmygeotabasyncdefmain():
client=mygeotab.API(
username='hello@example.com',
password='mypass',
database='MyDatabase',
)
client.authenticate()
devices=awaitclient.get_async('Device', name='%Test Dev%')
print(devices)
asyncio.run(main())

Command-line tool

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 MyDatabase

Documentation

Full API reference and guides are at https://mygeotab-python.readthedocs.io/en/latest/.

License

Apache 2.0. See LICENSE for details.

About

A Python client for the MyGeotab API.

Topics

Resources

Stars

20 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages