nexalware
Typed client for the Nexalware API, control physical devices and read their telemetry from any Python agent or app. Zero third-party dependencies, built on urllib from the standard library, so dropping it into any existing agent environment can never trigger a version conflict.
Writing in TypeScript instead? See @nexalware/sdk on npm. Want an MCP-aware host to discover these as tools automatically instead of calling them from code? See @nexalware/mcp.
Install
pip install nexalware
Quickstart
from nexalware import NexalwareClient
client = NexalwareClient(api_key="nxw_live_sk_your_key_here")
client.turn_on("dev_a1b2c3")
latest = client.get_latest_telemetry("dev_a1b2c3")
print(latest["state"], latest["telemetry"])
Get an API key from the dashboard (API Keys), and make sure it has a DeviceGrant covering the device(s) and command(s) you call, an ungranted key authenticates fine but every call is rejected with a 403.
Field names match the API's own JSON, not snake_case. Return values are plain
dicts (typed asTypedDictfor editor/type-checker support), with the same field names the REST API itself uses, e.g.latest["subDeviceId"], notlatest["sub_device_id"]. Method and argument names are proper Pythonsnake_case, only the data payloads keep the wire format.
NexalwareClient(api_key, base_url=...)
| Param | Type | Required | Meaning |
|---|---|---|---|
api_key |
str | yes | A secret key from the dashboard. |
base_url |
str | no | Override for a self-hosted or staging deployment. Defaults to https://api.nexalware.com. |
timeout |
float | no | Abort a request after this many seconds. Defaults to 30.0. |
Errors
Every method raises NexalwareApiError on a non-2xx response, it never returns a "silent" error value.
| Attribute | Type | Meaning |
|---|---|---|
status |
int | HTTP status code. |
error |
str | Short machine-readable code, e.g. "FORBIDDEN", "NOT_FOUND". |
message |
str | None | Human-readable reason, same text a dashboard user would see. |
details |
list | None | Only present on a 400 validation failure. |
from nexalware import NexalwareApiError
try:
client.send_command("dev_a1b2c3", "SET_BRIGHTNESS", params={"level": 60})
except NexalwareApiError as err:
print(err.status, err.error, err.message)
Methods
list_devices(project_id=None)- the devices this key can actually act on, only what its own DeviceGrant(s) cover. Call this first to discover validdevice_idvalues instead of needing them hardcoded or pasted in.get_commands(device_id)- the command catalog this device accepts.send_command(device_id, cmd, params=None, target=None)- send a command to a device, or, withtargetset, to one specific sub-device behind it.turn_on(device_id)/turn_off(device_id)- shorthand forsend_command(device_id, "ON" | "OFF").get_telemetry(device_id, metric=None, limit=None, since=None)- historical telemetry readings, newest first.get_latest_telemetry(device_id)- current state snapshot plus the most recent reading per metric.list_sub_devices(device_id)/get_sub_device(device_id, sub_device_id)- physical devices connected locally behind a master device.get_sub_device_telemetry(device_id, sub_device_id, metric=None, limit=None, since=None)- same shape asget_telemetry, scoped to one sub-device.send_sub_device_command(device_id, sub_device_id, cmd, params=None)- convenience wrapper oversend_commandwithtargetalready set.list_schedules(device_id)/get_schedule_context(device_id)- a device's active schedules, and the commands available to schedule.create_schedule(device_id, slot, on_ts, off_ts, ...)/update_schedule(...)/delete_schedule(device_id, slot)- manage a device's schedule slots (0-4).get_schedule_history(device_id)- a device's completed or cancelled schedules, most recent first.
Full parameter/return types for every method: SDK Reference.
Links
- Docs
- Device Orchestration - sub-devices, and the contract a master implements to report them.
- Authentication & Access - API keys and DeviceGrants.
License
MIT
Release files for nexalware 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nexalware-0.1.1.tar.gz | 11.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nexalware-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.7 kB
Release files / nexalware-0.1.1.tar.gz
| Download URL | nexalware-0.1.1.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17dca35803fcdc96ab3a8af7e42f51cb5816b16d329434e78bee480dcb4f54ec
|
|
BLAKE2b-256 checksum How to use checksums |
4c00a5c5f25ebd336404051a74579c8dad3f5eab54fdef3e2f206e306bf02558
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / nexalware-0.1.1-py3-none-any.whl
| Download URL | nexalware-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
133e0c53ddcb87c47ba4f799dee9384e42b9ac928c684e44ce179987a88c1c46
|
|
BLAKE2b-256 checksum How to use checksums |
1c85314e626fc2adffde5bec997b264255d77ad1e9c48b2ba4e6a66cc3a2aad1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|