Official Python SDK for the Scadable IoT platform.
Project description
Scadable Python SDK
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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70edf71bdc32adef01f84560893593305775b715dd7c340ddd862f9117ed427d
|
|
| MD5 |
f34aa4f6d71841cc447ecddc4eb5ec27
|
|
| BLAKE2b-256 |
838d202ff9646a7c72ea98d929f02221621517358c81f017fd49d71952fc47db
|
Provenance
The following attestation bundles were made for scadable-2.0.2.tar.gz:
Publisher:
python-publish.yml on scadable/library-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scadable-2.0.2.tar.gz -
Subject digest:
70edf71bdc32adef01f84560893593305775b715dd7c340ddd862f9117ed427d - Sigstore transparency entry: 1174166113
- Sigstore integration time:
-
Permalink:
scadable/library-python@be4fb453fb9eec005b21443c0e3c5410aafe2923 -
Branch / Tag:
refs/tags/2.0.2 - Owner: https://github.com/scadable
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@be4fb453fb9eec005b21443c0e3c5410aafe2923 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78497c7834e5dec270cd91a19913aa86552ead1b3ad8d18b6691c82b691dcefc
|
|
| MD5 |
010248d4876b14c8592e15dc550d3a48
|
|
| BLAKE2b-256 |
d7e9e914655131c2faff686318990b4717e60e14491c225fbb6b624be4fcf865
|
Provenance
The following attestation bundles were made for scadable-2.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on scadable/library-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scadable-2.0.2-py3-none-any.whl -
Subject digest:
78497c7834e5dec270cd91a19913aa86552ead1b3ad8d18b6691c82b691dcefc - Sigstore transparency entry: 1174166159
- Sigstore integration time:
-
Permalink:
scadable/library-python@be4fb453fb9eec005b21443c0e3c5410aafe2923 -
Branch / Tag:
refs/tags/2.0.2 - Owner: https://github.com/scadable
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@be4fb453fb9eec005b21443c0e3c5410aafe2923 -
Trigger Event:
release
-
Statement type: