Skip to content

Setting up a CLAID application on a PC or Server

CLAID runs natively on Linux and macOS, and on Windows via WSL. The easiest way to run CLAID on PCs or Servers is to use our Python package. You can install it via pip:

Installing the CLAID Python package

Use the following command to install the CLAID Python package on your device:

pip install claid

Note: Does not work natively on Windows! Windows is only supported via WSL

Creating a CLAID application in Python

Once you have installed the package, you can use CLAID in Python. Check out the code below.

Using CLAID in Python

The easiest way to use CLAID on a PC/Server is via Python. Check out the code below to start CLAID via a Python script. **You will also need to create a CLAID configuration file ssee below

from claid import CLAID
from claid.module.module_factory import ModuleFactory

module_factory = ModuleFactory()
module_factory.register_default_modules()

# Optional: Register custom modules.
# module_factory.register_module(MyModule())

claid.start(
    "claid_config.json", # config_path: Path to the CLAID configuration file, you will need to create this in Section 2.
    "Server", # hostname: Name of the host to execute. Needs to match with the "hostname" in the CLAID configuration.
    "the_server_user", # user_id: User name of the server. Can be any string.
    "the_server_device", # device_id: Device name of the server. Can be any string.
    module_factory # module_factory: Module factory to register custom modules.
)

Creating a CLAID configuration

As you can see from the code above, you need to provide the path to a configuration file ("config_path") when starting CLAID in Python using the code above. You will learn more about configuration files, hosts and user names etc. in Tutorial Series 2. For now, simply create a CLAID configuration file called "claid_config.json" in the same folder where you have put your Python file. Insert the following content:

claid_config.json

The following is the content for a basic CLAID configuration file. Note that the hostname must match the hostname specified when using claid.start(...) in the Python code above.

{
    "hosts": [
        {
        "hostname": "Server",
        "modules": []
        }
    ]
}