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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyiotb-0.1.2.tar.gz.
File metadata
- Download URL: pyiotb-0.1.2.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92fdf04df9dc1ffba12ebd81066510e77e07ebd2510e907b08134c9459518c11
|
|
| MD5 |
a7cb9dfd24c07099c1acd560bff860f6
|
|
| BLAKE2b-256 |
a0b6ce1e612b173ef2242ee5fe76190c8f4ebcc9f166a961e7119aafaf610b90
|
File details
Details for the file pyiotb-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pyiotb-0.1.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ab54d727dcaccf06a0dafe7e61d186795ec68676317d54b5c51e75cefffe3fc
|
|
| MD5 |
691f2fdf9d8d5f4a724c92cb0c8b0c74
|
|
| BLAKE2b-256 |
d16a1d9255cc88f7aa4013b789d9bb4beee74c4d0fa859c3c9574dda8db8ac56
|