{"id":13571638,"url":"https://github.com/Elektordi/obs-websocket-py","last_synced_at":"2025-04-04T08:31:45.956Z","repository":{"id":21986801,"uuid":"94654378","full_name":"Elektordi/obs-websocket-py","owner":"Elektordi","description":"Python library to communicate with an obs-websocket server (for OBS Studio)","archived":false,"fork":false,"pushed_at":"2024-08-09T17:40:54.000Z","size":175,"stargazers_count":249,"open_issues_count":17,"forks_count":61,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-13T01:48:19.563Z","etag":null,"topics":["obs-studio","obs-websocket","python","python-library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Elektordi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-17T23:24:54.000Z","updated_at":"2025-03-10T18:19:29.000Z","dependencies_parsed_at":"2024-01-14T03:51:13.070Z","dependency_job_id":"38a5b0e7-fb05-4737-9daf-1b402bd92cb8","html_url":"https://github.com/Elektordi/obs-websocket-py","commit_stats":{"total_commits":64,"total_committers":6,"mean_commits":"10.666666666666666","dds":0.140625,"last_synced_commit":"5099bbd6930d204000cbb12e7e290e087d138206"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elektordi%2Fobs-websocket-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elektordi%2Fobs-websocket-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elektordi%2Fobs-websocket-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elektordi%2Fobs-websocket-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Elektordi","download_url":"https://codeload.github.com/Elektordi/obs-websocket-py/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247147401,"owners_count":20891688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["obs-studio","obs-websocket","python","python-library"],"created_at":"2024-08-01T14:01:04.157Z","updated_at":"2025-04-04T08:31:40.949Z","avatar_url":"https://github.com/Elektordi.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# obs-websocket-py\nPython3 library to communicate with an [obs-websocket](https://github.com/Palakis/obs-websocket) server.\n\n_Licensed under the MIT License_\n\n## Project pages\n\nGitHub project: https://github.com/Elektordi/obs-websocket-py\n\nPyPI package: https://pypi.org/project/obs-websocket-py/\n\n## Installation\n\nJust run `pip3 install obs-websocket-py` in your Python venv or directly on your system.\n\nFor manual install, git clone the github repo and copy the directory **obswebsocket** in your python project root.\n\n**Requires**: websocket-client (from pip)\n\n## Usage\n\nSee python scripts in the [samples](https://github.com/Elektordi/obs-websocket-py/tree/master/samples) directory.\n\nOr take a look at the documentation below:\n\n_Output of `pydoc obswebsocket.core.obsws`:_\n\n```\nHelp on class obsws in obswebsocket.core:\n\nobswebsocket.core.obsws = class obsws\n |  Core class for using obs-websocket-py\n |  \n |  Simple usage: (v5 api)\n |      \u003e\u003e\u003e from obswebsocket import obsws, requests\n |      \u003e\u003e\u003e client = obsws(\"localhost\", 4455, \"secret\")\n |      \u003e\u003e\u003e client.connect()\n |      \u003e\u003e\u003e client.call(requests.GetVersion()).getObsVersion()\n |      '29.0.0'\n |      \u003e\u003e\u003e client.disconnect()\n |  \n |  Legacy usage: (v4 api)\n |      \u003e\u003e\u003e from obswebsocket import obsws, requests\n |      \u003e\u003e\u003e client = obsws(\"localhost\", 4444, \"secret\", legacy=True)\n |      \u003e\u003e\u003e client.connect()\n |      \u003e\u003e\u003e client.call(requests.GetVersion()).getObsStudioVersion()\n |      '25.0.0'\n |      \u003e\u003e\u003e client.disconnect()\n |  \n |  For advanced usage, including events callback, see the 'samples' directory.\n |  \n |  Methods defined here:\n |  \n |  __init__(self, host='localhost', port=4444, password='', legacy=None, timeout=60, authreconnect=0, on_connect=None, on_disconnect=None)\n |      Construct a new obsws wrapper\n |      \n |      :param host: Hostname to connect to\n |      :param port: TCP Port to connect to (Default is 4444)\n |      :param password: Password for the websocket server (Leave this field empty if auth is not enabled)\n |      :param legacy: Server is using old obs-websocket protocol (v4). Default is v5 (False) except if port is 4444.\n |      :param timeout: How much seconds to wait for an answer after sending a request.\n |      :param authreconnect: Try to reconnect if websocket is closed, value is number of seconds between attemps.\n |      :param on_connect: Function to call after successful connect, with parameter (obsws)\n |      :param on_disconnect: Function to call after successful disconnect, with parameter (obsws)\n |  \n |  call(self, obj)\n |      Make a call to the OBS server through the Websocket.\n |      \n |      :param obj: Request (class from obswebsocket.requests module) to send\n |          to the server.\n |      :return: Request object populated with response data.\n |  \n |  connect(self)\n |      Connect to the websocket server\n |      \n |      :return: Nothing\n |  \n |  disconnect(self)\n |      Disconnect from websocket server\n |      \n |      :return: Nothing\n |  \n |  reconnect(self)\n |      Restart the connection to the websocket server\n |      \n |      :return: Nothing\n |  \n |  register(self, func, event=None)\n |      Register a new hook in the websocket client\n |      \n |      :param func: Callback function pointer for the hook\n |      :param event: Event (class from obswebsocket.events module) to trigger\n |          the hook on. Default is None, which means trigger on all events.\n |      :return: Nothing\n |  \n |  unregister(self, func, event=None)\n |      Unregister a new hook in the websocket client\n |      \n |      :param func: Callback function pointer for the hook\n |      :param event: Event (class from obswebsocket.events module) which\n |          triggered the hook on. Default is None, which means unregister this\n |          function for all events.\n |      :return: Nothing\n```\n\n## Problems?\n\nPlease check on [Github project issues](https://github.com/Elektordi/obs-websocket-py/issues), and if nobody else have experienced it before, you can [file a new issue](https://github.com/Elektordi/obs-websocket-py/issues/new).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FElektordi%2Fobs-websocket-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FElektordi%2Fobs-websocket-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FElektordi%2Fobs-websocket-py/lists"}