Metadata-Version: 2.4
Name: plyrana-sdk
Version: 0.1.0
Summary: Plyrana REST API Client — Python SDK auto-generated from OpenAPI spec. Connect to any self-hosted Plyrana instance.
Author-email: Plyrana <dev@plyrana.com>
License: AGPL-3.0
Project-URL: Homepage, https://github.com/plyrana/core
Project-URL: Documentation, https://github.com/plyrana/core/tree/main/sdk/python_api
Project-URL: Repository, https://github.com/plyrana/core
Project-URL: Issues, https://github.com/plyrana/core/issues
Keywords: plyrana,iot,device-hub,sdk,openapi,rest-api,mqtt,automation
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx<0.29.0,>=0.23.0
Requires-Dist: attrs>=22.2.0
Requires-Dist: python-dateutil>=2.8.0

# plyrana-sdk — Python SDK for Plyrana

Auto-generated Python client for the [Plyrana](https://github.com/plyrana/core) REST API. Full type safety via attrs, httpx-based, sync + async support.

## Install

```bash
pip install plyrana-sdk
```

## Quick Start

```python
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()`:

```python
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

```bash
curl http://localhost:8000/openapi.json > /tmp/openapi.json
openapi-python-client generate --path /tmp/openapi.json --overwrite
```

## License

AGPL-3.0 — see [LICENSE](../../LICENSE) in the main repo.
