Skip to main content

A declarative language in python for creating jsPsych experiments

Project description

PyPI GitHub Workflow Status PyPI - Downloads Link to docs License: MIT DOI

SweetBean

A declarative programming language built in Python, designed for the synthesis of behavioral experiments. It allows researchers to specify experiments once and seamlessly compile them into a jsPsych experiment for conducting studies with human participants or text-based simulations with synthetic participants using large-language models.

Features

  • Declarative language: Specify experiments once and compile them into a jsPsych experiment for conducting studies with human participants or text-based simulations with synthetic participants using large-language models.
  • Python-based: SweetBean is built in Python, making it accessible and easy to use for researchers and educators.

Integrate with other packages

This package seamlessly integrates with other packages aimed at running online behavioral experiments:

  • AutoRA: For closed loop research, automatic experiment deployment, participant recruitment, and data collection.
  • SweetPea: For experimental design.

But it can also be used as a standalone product.

Installation

The package is available on PyPI and can be installed via pip:

pip install sweetbean

Compatibility

SweetBean is compatible with the following version of jsPsych:

  • jsPsych: 7.x

Dependencies

Sweetbean has the following dependencies that need to be installed on your system:

  • Python: >=3.9, <4.0
  • java

Other versions may work but are not officially supported. If you experience issues, please report them!

Python Dependencies

The following Python packages are required and will be installed automatically via pip:

  • jinja2
  • transcrypt
  • pyppeteer
  • pillow

jsPsych Plugins

SweetBean does not support all jsPsych plugins, but new plugins are added regularly.
If you need support for a specific jsPsych plugin, please open an issue here.

Documentation

You can find examples and documentation here: https://autoresearch.github.io/sweetbean/

Issues

Please report any issues with this software or its documentation here.

Contributing

We are open to contributions to SweetBean. More information can be found here.

Collaborating

We are always interested in collaborating! If you like our work but need some tailoring for your specific use case, please contact ystrittmatter@princeton.edu.

Citation

If you would like to reference SweetBean in a publication, you can use the following BibTeX entry referencing the associated publication in the Journal of Open Source Software:

@article{Strittmatter2025, doi = {10.21105/joss.07703},
author = {Younes Strittmatter and Sebastian Musslick},
title = {SweetBean: A declarative language for behavioral experiments with human and artificial participants},
url = {https://doi.org/10.21105/joss.07703}, 
year = {2025}, 
publisher = {The Open Journal}, 
volume = {10}, 
number = {107}, 
pages = {7703}, 
journal = {Journal of Open Source Software},
doi = {10.21105/joss.07703}
}

About

This project is in active development by the Autonomous Empirical Research Group, Lead Designer Younes Strittmatter, led by Sebastian Musslick.

This research program was supported by Schmidt Science Fellows, in partnership with the Rhodes Trust, as well as the Carney BRAINSTORM program at Brown University.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sweetbean-1.3.8.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sweetbean-1.3.8-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

Details for the file sweetbean-1.3.8.tar.gz.

File metadata

  • Download URL: sweetbean-1.3.8.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for sweetbean-1.3.8.tar.gz
Algorithm Hash digest
SHA256 e3469c66c3862d94f8673d5761b0a7d580d45ef3c708cb4069ba7983537895de
MD5 64af841cef071e9ba5e5ec8a26ad212e
BLAKE2b-256 b0ccb6d90e1b23d84e1d8350fa4bd1c2291e412ee99657cff9c7867aa82172ba

See more details on using hashes here.

File details

Details for the file sweetbean-1.3.8-py3-none-any.whl.

File metadata

  • Download URL: sweetbean-1.3.8-py3-none-any.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for sweetbean-1.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 15477a086f3b4229fcccb361cd37a7ee15e0d5826adf36d77dff08428ef1daad
MD5 60c1bec64e77b86020dd19d34846c466
BLAKE2b-256 7eda3785bab50688afa3883c423e76f32defe271d2d35c6d723f3216bf98aa92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page