Skip to content

Setting up Python module

Locate pyworker folder

Navigate to the writable directory of your Omnis Studio installation, typically located inside the AppData folder on Windows or the Application Support folder on macOS. On Linux, the writable and read-only directories are the same.

Look for a folder named pyworker. This is where all the modules that can be used with the Python Worker will be installed.

Create module folder

Create a new folder inside pyworker and name it after your module. The folder's name will be used to identify your module when calling its methods through the Python Worker from Omnis Studio.

For example, if your module is named test_module, create a folder named test_module inside the pyworker directory.

Create entrypoint file

Inside your module's folder, we need to set up a file which will be loaded by the Python Worker. The file is where you can define your functions and import other packages - the Python Worker will automatically load this file and you can call the methods within from Omnis Studio.

For example, we can create a test function in our in the following way:
from omnis_calls import sendResponse, sendError

def test(param):
    return sendResponse({'unicode': 'Fingerspitzengef\xFChl is a German term.\nIt\u2019s pronounced as follows: [\u02C8f\u026A\u014B\u0250\u02CC\u0283p\u026Ats\u0259n\u0261\u0259\u02CCfy\u02D0l]'})