Metadata-Version: 2.4
Name: socketsignal
Version: 2.0.0
Summary: Python client for SocketSignal - bidirectional realtime RPC over raw WebSockets.
Author: Gravicode Studios
Maintainer: Gravicode Studios
License-Expression: MIT
Project-URL: Homepage, https://github.com/DotNetVibeCoderz/Vibe_Messaging/tree/main/SocketSignal
Project-URL: Documentation, https://github.com/DotNetVibeCoderz/Vibe_Messaging/blob/main/SocketSignal/docs/clients.md
Project-URL: Repository, https://github.com/DotNetVibeCoderz/Vibe_Messaging
Project-URL: Issues, https://github.com/DotNetVibeCoderz/Vibe_Messaging/issues
Keywords: socketsignal,websocket,websockets,rpc,realtime,bidirectional,asyncio
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
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: Topic :: Communications
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: websockets>=12.0
Dynamic: license-file

# SocketSignal — Python client

*Gravicode Studios, led by Kang Fadhil.*

Bidirectional RPC over WebSockets, on asyncio.

```bash
pip install websockets
python example.py       # needs a server: dotnet run --project ../../src/SocketSignal.Demo -- serve
```

```python
import asyncio
from socketsignal import SocketSignalClient

async def main():
    client = SocketSignalClient(call_timeout=10.0, auto_reconnect=True)

    @client.on("serverHello")
    async def hello(text):
        return "python heard you"

    await client.connect("ws://localhost:8080/ws/")
    print(await client.call("sum", 5, 7))   # 12
    await client.send("log", "no reply wanted")
    await client.close()

asyncio.run(main())
```

| | |
|---|---|
| Register | `client.on("name", handler)` or `@client.on("name")`; sync or async |
| Call | `await client.call("name", *args)` |
| Fire and forget | `await client.send("name", *args)` |
| Errors | `SignalInvocationError`, `SignalTimeoutError`, `SignalClosedError` |

Full guide: [docs/clients.md](../../docs/clients.md) · Protocol: [docs/protocol.md](../../docs/protocol.md)
