Sebastian Musslick, Annie Cherkaev, Ben Draut, Ahsan Butt, Pierce Darragh, Vivek Srikumar, Matthew Flatt and Jonathan D. Cohen
Behavior Research Methods, volume 54, 2, 2021.


Experimental design is a key ingredient of reproducible empirical research. Yet, given the increasing complexity of experimental designs, researchers often struggle to implement ones that allow them to measure their variables of interest without confounds. SweetPea ( is an open-source declarative language in Python, in which researchers can describe their desired experiment as a set of factors and constraints. The language leverages advances in areas of computer science to sample experiment sequences in an unbiased way. In this article, we provide an overview of SweetPea’s capabilities, and demonstrate its application to the design of psychological experiments. Finally, we discuss current limitations of SweetPea, as well as potential applications to other domains of empirical research, such as neuroscience and machine learning.


Bib Entry

  author = {Musslick, Sebastian and Cherkaev, Anastasia and Draut, Ben and Butt, Ahsan and Darragh, Pierce and Srikumar, Vivek and Flatt, Matthew and Cohen, Jonathan D.},
  title = {{SweetPea: A Standard Language for Factorial Experimental Design}},
  journal = {Behavior Research Methods},
  year = {2021},
  volume = {54}