Skip to content

User manual

Álvaro Puente edited this page Sep 18, 2025 · 10 revisions

Installation

Important

This repository has been built using Python 3.10 which is currently the only version compatible with this library.

It is highly recommended to create a virtual environment to maintain the dependencies isolated from the system. First of all, make sure virtualenv is already installed in your system:

pip install virtualenv

To create a virtual environment and activate it please type:

python3.10 -m venv runtime-env
source runtime-env/bin/activate

Now, it is time to build the library COGNIT library in the virtual environment. To do so, execute the setup.py file as it is done in the following way:

cd /path/to/device-runtime-py
python setup.py sdist

Then, it can be installed in the currently activated virtual environment executing:

pip install dist/cognit-0.0.0.tar.gz

Library dependencies,which are described in the requirements.txt, will also be installed during at this stage. By installing the COGNIT library in the virtual environment, it can be imported in any location while the virtual environment remain activated.

Configuration

So the library manages to communicate effectively with the COGNIT framework, a configuration file has to be provided to the DeviceRuntime class when is instantiated.

Please create a .yaml file with the following structure:

api_endpoint: "Cognit_Frontend_URL"
credentials: "user:password"

An example of configuration file can be also found here

Once the configuration file is created, provide its path to the DeviceRuntime class. The following example explains how to instantiate correctly a DeviceRuntime by providing a configuration file:

from cognit import device_runtime

my_device_runtime = device_runtime.DeviceRuntime("./examples/cognit-template.yml")

Clone this wiki locally