Metadata-Version: 2.4
Name: resonitepy
Version: 0.0.2
Summary: Unofficial Resonite API python library.
License: MIT
License-File: LICENCE
Author: brodokk
Author-email: brodokk@brodokk.space
Requires-Python: >=3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: pydantic (>=2.13.4,<3.0.0)
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
Requires-Dist: requests (>=2.28.1,<3.0.0)
Requires-Dist: tomli (>=2.4.1,<3.0.0)
Requires-Dist: websockets (>=16.1,<17.0)
Project-URL: Homepage, https://github.com/brodokk/resonitepy
Project-URL: Repository, https://github.com/brodokk/resonitepy
Description-Content-Type: text/markdown

# resonitepy

Unofficial Resonite API python library (HTTP + SignalR hub). Sync and async.

Based on a work by [neosvrpy](https://github.com/brodokk/neosvrpy).

The code is still in WIP mode, see the files `resonitepy/classes.py` and
`resonitepy/client.py` for how to use them. The SignalR protocol is yet
to be fully implemented.

## Install

`poetry install`

## Basuc Usage (sync)

```python
from resonitepy.client import Client
from resonitepy.classes import LoginDetails, LoginDetailsAuth

client = Client()
client.login(LoginDetails(
    ownerId="U-yourUserId",
    authentication=LoginDetailsAuth(password="your password"),
))

for contact in client.getContacts():
    print(contact.contactUsername, contact.contactStatus)
```

## Async with live events (via SignalR hub)

```python
import asyncio
from resonitepy.client import Client
from resonitepy.classes import LoginDetails, LoginDetailsAuth
from resonitepy.hub_manager import HubManager, EventTarget

async def main():
    client = Client()
    client.login(LoginDetails(
        ownerId="U-yourUserId",
        authentication=LoginDetailsAuth(password="your password"),
    ))
    hub = HubManager(client)
    await hub.connect()

    def on_message(args):
        print(args[0])

    hub.on(EventTarget.receivedMessage, on_message)
    await asyncio.sleep(3600)
    await hub.disconnect()

asyncio.run(main())
```
