mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2025-10-25 02:11:55 +00:00
A Python SDK for OBS Studio WebSocket v5.0
This is a wrapper around OBS Websocket. Not all endpoints in the official documentation are implemented.
Requirements
- OBS Studio
- OBS Websocket v5 Plugin
- Python 3.11 or greater
How to install using pip
pip install obsstudio-sdk
How to Use
Load connection info from toml config. A valid config.toml might look like this:
[connection]
host = "localhost"
port = 4455
password = "mystrongpass"
It should be placed next to your __main__.py file.
Otherwise:
Import and start using, keyword arguments are as follows:
host: obs websocket serverport: port to access serverpassword: obs websocket server password
Example __main__.py
import obsstudio_sdk as obs
# pass conn info if not in config.toml
cl = obs.ReqClient(host='localhost', port=4455, password='mystrongpass')
# Toggle the mute state of your Mic input
cl.toggle_input_mute('Mic/Aux')
Official Documentation
Languages
Python
100%