Skip to main content

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.

Metadata

Release files for sweetbean 1.3.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sweetbean 1.3.17
File Size Uploaded
sweetbean-1.3.17.tar.gz 2.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sweetbean 1.3.17
File Interpreter ABI Platform
sweetbean-1.3.17-py3-none-any.whl Python 3 none any Details

Total release size: 2.2 MB

Release files / sweetbean-1.3.17.tar.gz

Download URL sweetbean-1.3.17.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
25caf2a9bb64b63adee35235c365f0f83eebf8a6699a8b2ae5ee1f42a57f8b16
BLAKE2b-256 checksum
How to use checksums
8e89846c33939f84e0ddedaadf67688cd51d76caf4e5c366be07fb1f7f734e86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.24

Release files / sweetbean-1.3.17-py3-none-any.whl

Download URL sweetbean-1.3.17-py3-none-any.whl
Size 55.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
caa7221f58f5488faddcbbcf197666ffb1154673c2474228540cba95f2e42247
BLAKE2b-256 checksum
How to use checksums
a7e73286ea4fef187be1ca051b4f494a1ad8bd40bd1ab7e871aff4c58c6abeb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.24
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page