1.0.0 section added to changelog

readme updated to reflect changes.
This commit is contained in:
2023-06-28 03:36:38 +01:00
parent 418b97254f
commit 466f34f6a5
3 changed files with 58 additions and 3 deletions

View File

@@ -10,6 +10,8 @@
- A Streamlabs Socket API key.
- You can acquire this by logging into your Streamlabs.com dashboard then `Settings->Api Settings->API Tokens`
- Python 3.8 or greater
### How to install using pip
```
@@ -37,8 +39,8 @@ Example `__main__.py`:
import streamlabsio
def on_twitch_event(event, msg):
print(f"{event}: {msg.attrs()}")
def on_twitch_event(event, data):
print(f"{event}: {data.attrs()}")
def main():
@@ -58,6 +60,14 @@ if __name__ == "__main__":
From the [SocketIO docs](https://python-socketio.readthedocs.io/en/latest/client.html#managing-background-tasks), `client.sio.wait()` may be used if your application has nothing to do in the main thread.
### Client class
`streamlabsio.connect(token="<apikey>", raw=False)`
The following keyword arguments may be passed:
- `token`: str Streamlabs SocketIO api token.
- `raw`: boolean=False Receive raw json objects.
### Attributes
For event messages you may inspect the available attributes using `attrs()`.
@@ -69,6 +79,14 @@ def on_twitch_event(event, msg):
print(f"{event}: {msg.attrs()}")
```
### Errors
- `SteamlabsSIOConnectionError`: Exception raised when connection errors occur
### Logging
To view raw incoming event data set logging level to DEBUG. Check `debug` example.
### Official Documentation
- [Streamlabs Socket API](https://dev.streamlabs.com/docs/socket-api)