Expyriment is an open-source and platform independent light-weight Python library for designing and conducting timing-critical behavioural and neuroimaging experiments. The major goal is to provide a well-structured Python library for a script-based experiment development with a high priority on the readability of the resulting programme code. It has been tested extensively under Linux and Windows.
Expyriment is an all-in-one solution, as it handles the stimulus presentation, recording of I/O events, communication with other devices and the collection and preprocessing of data. It offers furthermore a hierarchical design structure, which allows an intuitive transition from the experimental design to a running programme. It is therefore also suited for students as well as experimental psychologists and neuroscientists with little programming experience.
- Florian Krause, Brain Innovation, Maastricht University, The Netherlands
- Oliver Lindemann, University of Potsdam, Germany
Publications & citation¶
If you have used Expyriment in your work, please cite the follwing publication:
Krause, F., & Lindemann, O. (2014). Expyriment: A Python library for cognitive and neuroscientific experiments. Behavior Research Methods, 46(2), 416-428. doi:10.3758/s13428-013-0390-6
- Easy syntax, very readable (due to Python)
- Cross-platform (Linux, Windows, OS X)
- Allows for fast and efficient programming of experiments (do more with less code)
- A variety of standard stimuli (Text, Picture, Audio, Video etc.)
- Keyboard, Mouse, Serial Port, Parallel Port and Gamepad support
- Hierarchical structure of experimental units (Experiment, Blocks, Trials, Stimuli)
For a full documentation of all Expyriment functionality (i.e. all available modules, classes, methods, functions, constants, and attributes provided by the Expyriment Python package), please have a look at the API reference pages
Examples of full experiments can be found here
Creating experiments, blocks, trials and stimuli:
exp = expyriment.design.Experiment() block = expyriment.design.Block() trial = expyriment.design.Trial() stimulus = expyriment.stimuli.TextLine(text="Hello World")
Building a hierarchy between various structures:
trial.add_stimulus(stimulus) block.add_trial(trial) exp.add_block(block)
for block in exp.blocks: for trial in block.trials: trial.stimuli.present()
Handling input devices:
button, rt = exp.keyboard.wait([expyriment.misc.constants.K_SPACE])
Expyriment is free software and released under the Open Source GNU General Public Licence of the Free Software Foundation.
Source code repository¶
The Expyriment source code repository is currently hosted on GitHub. Get a local copy of this repository with this command:
git clone https://github.com/expyriment/expyriment.git
Suggestions and bug tracking¶
Expyriment newsletter: All users of Expyriment should subscribe to the Expyriment newsletter, since the project is still under development. All modifications and new versions will be announced via this mailing list. (Visit website or send an email to email@example.com).
Expyriment users mailing list: If you have questions regarding the installation, usage or documentation of Expyriment please don’t hesitate to contact the Expyriment users mailing list (visit website or send an email to firstname.lastname@example.org) or contact us directly by sending an email to email@example.com.