# Wwise Authoring API (Waapi) Client for Python
Decoupled autobahn WAMP client with support for plain options and bindable subscription callbacks.
## Requirements
* Non-EOL Python 3.x version (see `tox.ini` for versions tested). Refer to the official [Status of Python versions](https://devguide.python.org/versions)
* [Wwise](https://www.audiokinetic.com/en/download) instance with the Wwise Authoring API enabled (`Project > User Preferences... > Enable Wwise Authoring API`)
## Setup
On Windows, it is recommended to use the [Python Launcher for Windows](https://docs.python.org/3/using/windows.html#launcher) which is installed with Python 3 from [python.org](https://www.python.org).
* Windows: `py -3 -m pip install waapi-client`
* Other platforms: `python3 -m pip install waapi-client`
## Usage
```python
from waapi import WaapiClient
with WaapiClient() as client:
result = client.call("ak.wwise.core.getInfo")
```
The `with` statement automatically closes the connection and unregisters subscribers.
To keep the connection alive, instantiate `WaapiClient` and call `disconnect` when you are done.
```python
from waapi import WaapiClient
# Connect (default URL)
client = WaapiClient()
# RPC
result = client.call("ak.wwise.core.getInfo")
# Subscribe
handler = client.subscribe(
"ak.wwise.core.object.created",
lambda object: print("Object created: " + str(object))
)
# Bind a different callback at any time
def my_callback(object):
print("Different callback: " + str(object))
handler.bind(my_callback)
# Unsubscribe
handler.unsubscribe()
# Disconnect
client.disconnect()
```
Be aware that failing to call `disconnect` will result in the program to appear unresponsive, as the background thread
running the connection will remain active.
## Contribute
This repository accepts pull requests.
You may open an [issue](https://github.com/audiokinetic/waapi-client-python/issues) for any bugs or improvement requests.
### Local Install
You may install the package locally using either pip or pipenv.
Clone this repository, then from the repository root run:
* Windows: `py -3 -m pip install -e .`
* Other platforms: `python3 -m pip install -e .`
or
`pipenv install --three`
### Running the Tests
Install the `tox` package:
* Windows: `py -3 -m pip install tox`
* Other platforms: `python3 -m pip install tox`
Open a blank project in Wwise, then you may execute `tox` in the terminal from the root of the repository
The test suite will run for all supported versions of Python.
Use `-e pyXX` to run for a single version, e.g., `tox -e py312` for Python 3.12).
Raw data
{
"_id": null,
"home_page": "https://github.com/audiokinetic/waapi-client-python",
"name": "waapi-client",
"maintainer": "Samuel Longchamps",
"docs_url": null,
"requires_python": null,
"maintainer_email": "slongchamps@audiokinetic.com",
"keywords": "waapi, wwise, audiokinetic",
"author": "Audiokinetic",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/7e/cd/0bf35687b6ec7817d5de636c940fe0ded1222ce996e0f0ac935b1d88130f/waapi_client-0.7.2.tar.gz",
"platform": "any",
"description": "# Wwise Authoring API (Waapi) Client for Python\r\nDecoupled autobahn WAMP client with support for plain options and bindable subscription callbacks.\r\n\r\n## Requirements\r\n* Non-EOL Python 3.x version (see `tox.ini` for versions tested). Refer to the official [Status of Python versions](https://devguide.python.org/versions)\r\n* [Wwise](https://www.audiokinetic.com/en/download) instance with the Wwise Authoring API enabled (`Project > User Preferences... > Enable Wwise Authoring API`)\r\n\r\n## Setup\r\nOn Windows, it is recommended to use the [Python Launcher for Windows](https://docs.python.org/3/using/windows.html#launcher) which is installed with Python 3 from [python.org](https://www.python.org).\r\n\r\n* Windows: `py -3 -m pip install waapi-client`\r\n* Other platforms: `python3 -m pip install waapi-client`\r\n\r\n## Usage\r\n```python\r\nfrom waapi import WaapiClient\r\n\r\nwith WaapiClient() as client:\r\n result = client.call(\"ak.wwise.core.getInfo\")\r\n```\r\n\r\nThe `with` statement automatically closes the connection and unregisters subscribers.\r\nTo keep the connection alive, instantiate `WaapiClient` and call `disconnect` when you are done.\r\n\r\n```python\r\nfrom waapi import WaapiClient\r\n\r\n# Connect (default URL)\r\nclient = WaapiClient()\r\n\r\n# RPC\r\nresult = client.call(\"ak.wwise.core.getInfo\")\r\n\r\n# Subscribe\r\nhandler = client.subscribe(\r\n \"ak.wwise.core.object.created\",\r\n lambda object: print(\"Object created: \" + str(object))\r\n)\r\n\r\n# Bind a different callback at any time\r\ndef my_callback(object):\r\n print(\"Different callback: \" + str(object))\r\n\r\nhandler.bind(my_callback)\r\n\r\n# Unsubscribe\r\nhandler.unsubscribe()\r\n\r\n# Disconnect\r\nclient.disconnect()\r\n```\r\n\r\nBe aware that failing to call `disconnect` will result in the program to appear unresponsive, as the background thread\r\nrunning the connection will remain active.\r\n\r\n## Contribute\r\nThis repository accepts pull requests.\r\nYou may open an [issue](https://github.com/audiokinetic/waapi-client-python/issues) for any bugs or improvement requests.\r\n\r\n### Local Install\r\nYou may install the package locally using either pip or pipenv.\r\n\r\nClone this repository, then from the repository root run:\r\n\r\n* Windows: `py -3 -m pip install -e .`\r\n* Other platforms: `python3 -m pip install -e .`\r\n\r\nor\r\n\r\n`pipenv install --three`\r\n\r\n### Running the Tests\r\nInstall the `tox` package:\r\n\r\n* Windows: `py -3 -m pip install tox`\r\n* Other platforms: `python3 -m pip install tox`\r\n\r\nOpen a blank project in Wwise, then you may execute `tox` in the terminal from the root of the repository\r\n\r\nThe test suite will run for all supported versions of Python.\r\nUse `-e pyXX` to run for a single version, e.g., `tox -e py312` for Python 3.12).\r\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Wwise Authoring API client.",
"version": "0.7.2",
"project_urls": {
"Download": "https://github.com/audiokinetic/waapi-client-python/releases",
"Homepage": "https://github.com/audiokinetic/waapi-client-python"
},
"split_keywords": [
"waapi",
" wwise",
" audiokinetic"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "37879942a33cb714e8271d23878a4c12199b6dcb1d36bcf7d94785a391a5e675",
"md5": "86282124552e8e280129cab21970f602",
"sha256": "556858614e4a4cf8ea103b8ab07ceb5d131ad37d3bdbd4cd2a24104556dd0af6"
},
"downloads": -1,
"filename": "waapi_client-0.7.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "86282124552e8e280129cab21970f602",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18874,
"upload_time": "2024-05-30T20:53:46",
"upload_time_iso_8601": "2024-05-30T20:53:46.316421Z",
"url": "https://files.pythonhosted.org/packages/37/87/9942a33cb714e8271d23878a4c12199b6dcb1d36bcf7d94785a391a5e675/waapi_client-0.7.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7ecd0bf35687b6ec7817d5de636c940fe0ded1222ce996e0f0ac935b1d88130f",
"md5": "ff9990b4ff1574d58e9fd917ef88e80e",
"sha256": "4f858e9c721a69dad5e4edc731c631bb45c738cd61e46363d0a6878569ce2555"
},
"downloads": -1,
"filename": "waapi_client-0.7.2.tar.gz",
"has_sig": false,
"md5_digest": "ff9990b4ff1574d58e9fd917ef88e80e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17096,
"upload_time": "2024-05-30T20:54:31",
"upload_time_iso_8601": "2024-05-30T20:54:31.943495Z",
"url": "https://files.pythonhosted.org/packages/7e/cd/0bf35687b6ec7817d5de636c940fe0ded1222ce996e0f0ac935b1d88130f/waapi_client-0.7.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-30 20:54:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "audiokinetic",
"github_project": "waapi-client-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "waapi-client"
}