Skip to main content

Official Python SDK for the Scadable IoT platform.

Project description

Scadable Python SDK

PyPi Downloads Supported Versions GitHub actions status

The official Python SDK for the Scadable IoT platform. Check gateway status, list devices, and stream live telemetry in 3 lines of code.

Install

pip install scadable

Quick Start

from scadable import Scadable

client = Scadable(api_key="sk_live_...")

# List gateways
for gw in client.gateways.list():
    print(f"{gw.name}: {gw.status}")

# Get gateway detail
gw = client.gateways.get("gateway-id")
print(gw.name, gw.status)

# List devices on a gateway
for device in client.gateways.devices("gateway-id"):
    print(f"{device.name} [{device.status}]")

Stream Live Telemetry

import asyncio
from scadable import AsyncScadable

async def main():
    client = AsyncScadable(api_key="sk_live_...")

    async with client.gateways.stream("gateway-id") as stream:
        async for event in stream:
            print(event.type, event.data)

asyncio.run(main())

Authentication

Pass your API key directly or set it as an environment variable:

# Direct
client = Scadable(api_key="sk_live_...")

# Environment variable
# export SCADABLE_API_KEY=sk_live_...
client = Scadable()

API keys are created in the Scadable Dashboard under project settings.

Error Handling

from scadable import Scadable, AuthenticationError, NotFoundError

client = Scadable(api_key="sk_live_...")

try:
    gw = client.gateways.get("bad-id")
except NotFoundError:
    print("Gateway not found")
except AuthenticationError:
    print("Invalid API key")

Requirements

  • Python 3.10+
  • Dependencies: httpx, pydantic, websockets

License

Apache 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

scadable-2.0.2.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

scadable-2.0.2-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file scadable-2.0.2.tar.gz.

File metadata

  • Download URL: scadable-2.0.2.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scadable-2.0.2.tar.gz
Algorithm Hash digest
SHA256 70edf71bdc32adef01f84560893593305775b715dd7c340ddd862f9117ed427d
MD5 f34aa4f6d71841cc447ecddc4eb5ec27
BLAKE2b-256 838d202ff9646a7c72ea98d929f02221621517358c81f017fd49d71952fc47db

See more details on using hashes here.

Provenance

The following attestation bundles were made for scadable-2.0.2.tar.gz:

Publisher: python-publish.yml on scadable/library-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scadable-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: scadable-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scadable-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 78497c7834e5dec270cd91a19913aa86552ead1b3ad8d18b6691c82b691dcefc
MD5 010248d4876b14c8592e15dc550d3a48
BLAKE2b-256 d7e9e914655131c2faff686318990b4717e60e14491c225fbb6b624be4fcf865

See more details on using hashes here.

Provenance

The following attestation bundles were made for scadable-2.0.2-py3-none-any.whl:

Publisher: python-publish.yml on scadable/library-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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