Skip to main content

Python client for the TIREMO SDK REST and live WebSocket APIs

Project description

tiremo-sdk-client

Official Python client for the TIREMO SDK — REST bootstrap plus an async WebSocket live channel for telemetry, presence, and alarms.

Requires Python 3.10+.

Documentation

Topic Link
SDK Live Data docs.tiremo.ai/developer-guide/sdk-live-data
API Key Security docs.tiremo.ai/developer-guide/sdk-api-key-security
Source & issues TIREMO-SDK-CLIENT

Install

pip install tiremo-sdk-client

From source (development):

make venv lint    # creates .venv and installs editable package
# or from repo root: make install-python
pip install .

Usage

import asyncio

from tiremo_sdk import TiremoClient

async def main() -> None:
    client = TiremoClient(
        api_key="your-api-key",
        base_url="https://sdk.tiremo.ai",
    )

    latest = await client.get_telemetry_latest("device-123", keys=["temperature"])
    print(latest)

    token_response = await client.create_live_token()
    live = client.connect_live_with_token(token_response["token"])

    async def on_telemetry(event: dict) -> None:
        print(event["data"])

    live.on("telemetry", on_telemetry)
    await live.connect()
    await live.subscribe_telemetry("temp", "device-123", keys=["temperature"])
    await asyncio.sleep(60)
    await live.disconnect()

asyncio.run(main())

Related packages

Package Use case
@empa-electronics/tiremo-sdk-client-js Browser / bundler
@empa-electronics/tiremo-sdk-client-node Node.js 18+

Release

Uses a local .venv (Python 3.12 by default — avoids Homebrew 3.14 pyexpat issues on macOS).

make venv
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=<pypi-api-token>
make release    # bumps patch in pyproject.toml, builds, uploads

To bump version only: make patch

CI: bump version in pyproject.toml, commit, push tag client-python/v<version> (PyPI Trusted Publishing → workflow publish-client-python.yml).

License

ISC — Empa Electronics

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

tiremo_sdk_client-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

tiremo_sdk_client-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file tiremo_sdk_client-0.1.0.tar.gz.

File metadata

  • Download URL: tiremo_sdk_client-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for tiremo_sdk_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 029756d38ae2adaf93b64814bd7da1530d8648df84b3a9bede1aa39eafc31182
MD5 cef28fe685b395038592862f9711d8a0
BLAKE2b-256 67b8d456314ba91f47bf213bf91021655b2f3deea42df1f92b3f04968074d381

See more details on using hashes here.

File details

Details for the file tiremo_sdk_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tiremo_sdk_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc372ed6c7d5f26d8aedcd3102082bdd743479d56583bb37da1229275e62c85d
MD5 2cd955cc964987d61da841b5781c67f7
BLAKE2b-256 db727ef8c624bb361b0e501838e88b0bb32c4da2c59fd7f5178b07214ac8e9da

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