Looking time and stimulus presentation system for PsychoPy.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
PyHab User Manual.pdf



Documentation Status
Looking time and stimulus presentation system for PsychoPy.

What is PyHab?

Research with human infants (and some non-human animals) often relies on measuring looking times. Infant eye-tracking is still expensive, imprecise, and relatively unreliable, so manual looking time coding is still very common. Currently, they are only a handful of programs built for this purpose, especially for live coding of looking times (during the experiment), and those programs are old, opaque, and difficult to integrate with stimulus presentation. Many studies that control stimulus presentation on the basis of infant's looking (starting a trial when they look at the display, ending it when they look away for a given period of time) still require two experimenters, one to control the stimuli and one to code the looking times.

I felt that it was time for an update, so I built a script that runs in PsychoPy (freely available from psychopy.org) that can both replace older looking-time coding software with something open-source, and also control stimulus presentation directly.

Important notes

  • PyHab is not a stand-alone program. It is a script that runs in PsychoPy. You will need to install PsychoPy. The latest stable version, as of this writing, is 1.90.3
  • PyHab has a rudimentary graphical interface for building new studies, but you will still need to open the program initially in PsychoPy's coder view. Read the manual before your begin!
  • PyHab is still very much in development! Don't be shy about contacting me for feature requests. It is now much more flexible than it was, but there are still some designs it cannot produce I'm sure, and I would love to hear about them.
  • If you do use PyHab for a study that you then submit for publication, please cite both PsychoPy and PyHab. PyHab relies very heavily on PsychoPy (but is not directly affiliated with or developed by the makers of PsychoPy), so credit is due as much to them as it is to me.
  • Please join the Pyhab announcements mailing list for news about updates and important technical information
  • KNOWN ISSUES: There may be an issue with multi-monitor displays where one of them is a Mac Retina display, starting with MacOS 10.13.5 (High Sierra June 2018). I am investigating the problem, but non-Retina displays or earlier versions of MacOS should be unaffected. Non-Macs are obviously unaffected.

"Installing" PyHab

Click the big green button, hit "download as zip" (or go to releases and select "source code.zip"), unzip the file into a folder, and put the folder wherever you want. Make sure you do not move anything around inside the folder.

Then, just open PsychoPy, go to coder view (found in the 'view' dropwdown menu or with the shortcuts control-L or command-L), open "NewPyHabProject.py" from there, and hit the big green "Run" button.

You will need VLC media player installed on your computer in order to use PsychoPy to present movie stimuli. VLC is free, and you can download it here.

Citing PyHab and PsychoPy

Note that I do not have a formal article for PyHab yet (working on it). For the time being, please cite both of the following: