add support for toml config.

subject module added, supports callbacks.

events module added. Provides an event listener and callback trigger.

import isorted, code run through black.

toml section added to readme.

added a couple of examples.
This commit is contained in:
onyx-and-iris
2022-07-25 23:51:30 +01:00
parent 1793685be0
commit b5b69de218
14 changed files with 2719 additions and 481 deletions

View File

@@ -1,7 +1,8 @@
# obs_sdk
### A Python SDK for OBS Studio WebSocket v5.0
This is a wrapper around OBS Websocket.
This is a wrapper around OBS Websocket.
Not all endpoints in the official documentation are implemented. But all endpoints in the Requests section is implemented. You can find the relevant document using below link.
[obs-websocket github page](https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#Requests)
@@ -11,14 +12,26 @@ Not all endpoints in the official documentation are implemented. But all endpoin
pip install obsstudio-sdk
```
### How to Use
* Import and start using
Required parameters are as follows:
host: obs websocket server
port: port to access server
password: obs websocket server password
- Load connection info from toml config. A valid `config.toml` might look like this:
```toml
[connection]
host = "localhost"
port = 4455
password = "mystrongpass"
```
It should be placed next to your `__main__.py` file.
Otherwise:
- Import and start using
Parameters are as follows:
host: obs websocket server
port: port to access server
password: obs websocket server password
```
>>>from obsstudio_sdk.reqs import ReqClient
@@ -26,12 +39,12 @@ pip install obsstudio-sdk
>>>client = ReqClient('192.168.1.1', 4444, 'somepassword')
```
Now you can make calls to OBS
Now you can make calls to OBS
Example: Toggle the mute state of your Mic input
Example: Toggle the mute state of your Mic input
```
>>>cl.ToggleInputMute('Mic/Aux')
>>>
```
```