Plyrana REST API Client — Python SDK auto-generated from OpenAPI spec. Connect to any self-hosted Plyrana instance.
Project description
plyrana-sdk — Python SDK for Plyrana
Auto-generated Python client for the Plyrana REST API. Full type safety via attrs, httpx-based, sync + async support.
Install
pip install plyrana-sdk
Quick Start
from plyrana_sdk import AuthenticatedClient
from plyrana_sdk.api.devices import list_devices
from plyrana_sdk.api.variables import set_variable
from plyrana_sdk.models import VariableValueIn
client = AuthenticatedClient(
base_url="http://localhost:8000",
token="your-jwt-or-api-key",
)
# List all devices
devices = list_devices.sync(client=client)
for dev in devices:
print(dev.uid, dev.name)
# Set a variable
set_variable.sync(
device_uid="esp32-living-room",
key="temperature",
client=client,
body=VariableValueIn(value=22.5),
)
Async support
Every endpoint has .sync() and .asyncio():
import asyncio
from plyrana_sdk.api.devices import list_devices
async def main():
devices = await list_devices.asyncio(client=client)
print(devices)
asyncio.run(main())
Authentication
- JWT — from
POST /api/v1/auth/login - API Key — from Settings → API Keys (prefix
plk_)
Regenerate from latest spec
curl http://localhost:8000/openapi.json > /tmp/openapi.json
openapi-python-client generate --path /tmp/openapi.json --overwrite
License
AGPL-3.0 — see LICENSE in the main repo.
Project details
Release history Release notifications | RSS feed
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 plyrana_sdk-0.1.0.tar.gz.
File metadata
- Download URL: plyrana_sdk-0.1.0.tar.gz
- Upload date:
- Size: 241.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75e1317df515c9d2b007a1498cb3dabf15d53c023a401f5a779d6cb6875a4492
|
|
| MD5 |
7d77bcd271866474b1f4365755e57225
|
|
| BLAKE2b-256 |
3e912db5ee1c67e9c7c5dfd38cf99d29e5c00beed18cacdf68cf2c806990f1a1
|
File details
Details for the file plyrana_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: plyrana_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 959.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bbd68fbaa160459af460696944f83e1336fe290ad92c61df95d1e871caf9816
|
|
| MD5 |
b845565a707ad6a0597e4342eac1dc34
|
|
| BLAKE2b-256 |
cf3d2fbb684292b530d11d80bebcb71b9b44cea350901e9eec6baffa3fae7971
|