1.0.0 section added to changelog

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

9
.gitignore vendored
View File

@ -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
View 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

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)