Skip to main content

A library for interfacing to Tartabit IoT Bridge

Project description

iotb-py

This package provides some useful scripts for interacting with the Tartabit IoT Bridge from Python.

It implements the REST API that is available here: https://bridge-us.tartabit.com/swaggerui/

This package is expected to change frequently, and may be replaced by a formal python SDK in the future.

Using the client

from client import IotbClient

# authenticating with an application token
client = IotbClient("https://bridge-us.tartabit.com/api/v1/", token="AT:adfasdf....asdfasd")

# authenticating with a username and password
client = IotbClient("https://bridge-us.tartabit.com/api/v1/", username="user@domain.com", password="password")

resp = client.request("GET", "log", query={"limit": 20})

Utilities

download-logs.py

This utility downloads application logs from an instance of the IoT Bridge and saves them to a JSON file.

python download-logs.py -u "https://bridge-us.tartabit.com/api/v1" -t "AT:xxxx" -d 30 -q "level == \"warn\""
  • -u: The URL used to access the IoT Bridge API.
  • -t: The application token used to authenticate with the IoT Bridge.
  • -d: The number of days of logs to download.
  • -q: A query string used to filter the logs. Quotes must be escaped with '\'.

trigger-comparison.py

THis utility compares the triggers in two accounts and generates a file diff.txt with the differences between the two accounts.

python trigger-comparison.py --url1="https://bridge-us.tartabit.com/api/v1/" --url2="https://bride-us.armordata.io/api/v1/" --token1="AT:YYY" --token2="AT:XXX"

Building

To build the package, run the following command:

python -m venv .venv
. venv/bin/activate
python -m build
twine upload dist/*

License

Mozilla Public License Version 2.0

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

pyiotb-0.1.3.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

pyiotb-0.1.3-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file pyiotb-0.1.3.tar.gz.

File metadata

  • Download URL: pyiotb-0.1.3.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for pyiotb-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7390ba93429b0f4956b2bb6eba7995b10dd9f0dcc36f5112148f003d60f77029
MD5 b0845573f05afc451524973838e13ded
BLAKE2b-256 d08016e334e15a455e0851210c4fb69979579aa7db8ea10b38013bdf1ccbcb6a

See more details on using hashes here.

File details

Details for the file pyiotb-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pyiotb-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for pyiotb-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ec8c53308e8a1bf5fdf05d669e8139a3834cf287f87b49438333c142880ccdfe
MD5 32d168b0978b906aaa8d8a58aa75ad47
BLAKE2b-256 d4ffec0e3668b3317ab759f89c41e23be5d6a7a4ca66025207ced529a01ef8df

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