2022-06-05 12:40:55 +01:00
# obs_sdk
2022-07-25 23:51:30 +01:00
2022-06-05 12:40:55 +01:00
### A Python SDK for OBS Studio WebSocket v5.0
2022-07-25 23:51:30 +01:00
This is a wrapper around OBS Websocket.
2022-06-05 12:40:55 +01:00
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 )
2022-07-26 03:31:32 +01:00
## Requirements
- [OBS Studio ](https://obsproject.com/ )
- [OBS Websocket v5 Plugin ](https://github.com/obsproject/obs-websocket/releases/tag/5.0.0 )
- Python 3.11 or greater
2022-06-05 12:40:55 +01:00
### How to install using pip
```
pip install obsstudio-sdk
```
### How to Use
2022-07-25 23:51:30 +01:00
- 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
2022-06-05 12:40:55 +01:00
```
>>>from obsstudio_sdk.reqs import ReqClient
>>>
>>>client = ReqClient('192.168.1.1', 4444, 'somepassword')
```
2022-07-25 23:51:30 +01:00
Now you can make calls to OBS
2022-06-05 12:40:55 +01:00
2022-07-25 23:51:30 +01:00
Example: Toggle the mute state of your Mic input
2022-06-05 12:40:55 +01:00
```
>>>cl.ToggleInputMute('Mic/Aux')
>>>
2022-07-25 23:51:30 +01:00
```