The Expyriment plugin system (extras)¶
The design, stimuli, io and misc packages can be extended with plugins
(additional classes) that can be accessed via the ‘extras’ namespace of each
package. Expyriment will look for installed plugins in the following
locations within the
directory located in the current user’s home directory:
Any plugins found will be integrated into the .extras namespace of each
There are three ways to import extras:
Import all extras in one go:
import expyriment expyriment.import_all_extras()
Import all extras from a specific package:
import expyriment import expyriment.stimuli.extras
Import a specific plugin:
import expyriment from expyriment_stimuli_extras.dotcloud import DotCloud
Download plugins from stash¶
Several extra plugins can be found in the Expyriment stash. When Expyriment
has been installed with the option
all), all plugins can be
downloaded automatically by calling:
Alternatively, you can use the Command Line Interface:
When developing extra plugins, please consider making them available publicly in the Expyriment stash, by creating a pull request.
Basically, extra plugins are a simple Python module with a single class, where
the filename is the class name in lowercase. Additionally a file called
classname_defaults.py can be created which will hold the default values for
all parameters given when initializing the class. The naming convention is
For design and misc extras this is all there is, but for io and stimuli plugins, additional conventions need to be taken care of.
IO plugins have to inherit from
or both. This means they can also inherit from any other io class.
Stimulus plugins have to inherit from
expyriment.stimuli.Stimulus. This means
they can also inherit from any other stimulus class.
Additionally, every visual extra stimulus class (inherited from
_create_surface method that defines what happens when the stimulus is preloaded,
plotted or presented.