mirror of
https://github.com/onyx-and-iris/streamlabs-socketio-py
synced 2024-12-03 12:30:48 +00:00
1.0.0 section added to changelog
readme updated to reflect changes.
This commit is contained in:
parent
418b97254f
commit
466f34f6a5
9
.gitignore
vendored
9
.gitignore
vendored
@ -128,5 +128,12 @@ dmypy.json
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
.vscode/
|
||||
|
||||
# toml config
|
||||
config.toml
|
||||
config.toml
|
||||
|
||||
# test
|
||||
quick.py
|
||||
logging.json
|
||||
tests/
|
30
CHANGELOG.md
Normal file
30
CHANGELOG.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- [x]
|
||||
|
||||
## [1.0.0] - 2023-06-28
|
||||
|
||||
The only potential breaking change, a new error class raised if the initial connection fails.
|
||||
|
||||
|
||||
### Added
|
||||
|
||||
- tomllib/tomli now lazy loaded in _token_from_toml(). Allows possibility to run package without tomli.
|
||||
- module level logger
|
||||
- debug example
|
||||
- raw kwarg for receiving the raw json data.
|
||||
- `Path.home() / ".config" / "streamlabsio" / "config.toml"` added to config.toml filepaths.
|
||||
|
||||
### Changed
|
||||
|
||||
- Python minimum required version changed to 3.8
|
||||
- new error class
|
||||
- `SteamlabsSIOConnectionError` raised on a connection error
|
22
README.md
22
README.md
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user