iomotions
This (unofficial) project provides useful utilities for interfacing with iMotions software from third party applications.
Installation
To use this module add the following line to your requirements.txt file:
iomotions>=0.1.0
Then install your requirements as usual.
pip3 install -r requirements.txt
iMotions Setup
IMPORTANT: In order for the following functions to work you must ensure that in Global Preferences > API > Event Receiving both Enable event reception and Use TCP are checked.
API
iomotions module
start_scene_recording(ip_address, scene_name, scene_description = '')
Instruct the iMotions instance running at the designated IP address to start recording a scene with the prescribed name and optional description.
end_scene_recording(ip_address, scene_name)
Instruct the iMotions instance running at the designated IP address to end its recording of the named scene.
class EventEmitter
Helper class that stores connection information and exposes a simpler messaging API. This class is not well supported but can be used to send messages over UDP in place of the default TCP behavior of the above APIs.
iomotions.otree module
iomotions includes API for integrating with oTree out of the box. The provided iomotions.otree.pages.ScenePage class extends oTree's Page to record the page as a Scene in iMotions.
class ScenePage(otree.api.Page)
The ScenePage class should be subclassed in place of oTree's Page when you want iMotions to record the page. By using a ScenePage iMotions records a scene starting when the page begins loading and ending when the page transitions. The scene name is derived from the class name by default the current round number.
scene_name
If you would like to provide an alternative scene identifier than the class name, simply override the scene_name property with the string you would like to use instead.
scene_description
When provided, the description will be included with the scene marker in iMotions.
Full Example
# <app-name>/__init__.py
from iomotions.otree.pages import ScenePage
...
class QuizPage(ScenePage):
# optional, would default to QuizPage<round_number>
scene_name = 'Question'
# optional
scene_description = 'General knowledge question'
Note: The current round number will also be appended to the scene name to account for pages that appear in multi-round apps.
Note: For simplicity to the user the ScenePage class extends private functions from Page. The primary motivation for this is to avoid unexpected breakage from overriding before_next_page without calling ScenePage's implementation. Since the overridden methods are private it's possible that a future version of oTree will result in changes that break this API.
Metadata
Release files for iomotions 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| iomotions-0.1.0.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iomotions-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.3 kB
Release files / iomotions-0.1.0.tar.gz
| Download URL | iomotions-0.1.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1bc08b840df9d0fb47bc45cbc6283afd85c846711c803bdaf73009a6c9b50a97
|
|
BLAKE2b-256 checksum How to use checksums |
e0c08b554607d899a71e9d37493580dba905c71580434d16f7a926501572f449
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.7.13
|
Release files / iomotions-0.1.0-py3-none-any.whl
| Download URL | iomotions-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
964427c6e90ee3692834552c855bfd6f8a4efa5e1e44a62f080fdeef61b85092
|
|
BLAKE2b-256 checksum How to use checksums |
5f139d22721fbf6d44363d28ff706c8e9e18a7912cc0ab237ed3732d39c7ed91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.7.13
|