Skip to main content

Python client for interacting with Traccar GPS tracking API

Project description

Import

from traccar_api.api import TraccarApi

Initial

traccar = TraccarApi(URL, MAIL, PASS)

Login

current_user = traccar.login()

Bulks

server = traccar.get_server()
devices = traccar.get_devices()
devices_criteria = traccar.get_device(device_ids=[3, 38], device_unique_ids=["01442517SKYD066", "01433630SKYC6D3"])
users = traccar.get_users()
drivers = traccar.get_drivers()
groups = traccar.get_groups()

Singles

device = traccar.get_device(device_unique_ids=["01433630SKYC6D3"])
user = traccar.get_user(1)
driver = traccar.get_driver(301)

Permissions

permissions = traccar.get_current_user_permissions()
link_driver1_device1 = traccar.link_diver_device(driver_id=301, device_id=3)
link_driver2_device1 = traccar.link_diver_device(driver_id=302, device_id=3)
unlink_driver1_device1 = traccar.unlink_diver_device(driver_id=301, device_id=3)
unlink_driver2_device1 = traccar.unlink_diver_device(driver_id=302, device_id=3)

Errors

try:

    current_user = traccar.login()
    
except TraccarApiAuthenticationError as e:

    print(f"Authentication error: {e}")
    
except TraccarApiError as e:

    print(f"API error: {e}")

LogOut

traccar.logout()

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

traccar_api-0.3.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

traccar_api-0.3.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file traccar_api-0.3.0.tar.gz.

File metadata

  • Download URL: traccar_api-0.3.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for traccar_api-0.3.0.tar.gz
Algorithm Hash digest
SHA256 904ce0c64dfa4d78163e25b5df68250a4e58b2385846750d5c3f6883ddf17a7a
MD5 e377349028170ef8c469c79ac7f2ec74
BLAKE2b-256 8652baa5609b14fbee6014df43c28f2027c94dec33e1f0a3193a88342338b5b2

See more details on using hashes here.

File details

Details for the file traccar_api-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: traccar_api-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for traccar_api-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8a43498c8c51aeb043d085228f8a831e61d3ad6a63de798f5da8bc522e453fb
MD5 d829ab2743a25800be61f3e9909fcb79
BLAKE2b-256 09ee3679a3d804cdf07c9211445fe647551e8a7075dfbd32cc6a86460f5e82d0

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