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.14.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.14-py3-none-any.whl (50.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sweetbean-1.3.14.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.14.tar.gz
Algorithm Hash digest
SHA256 d1a0d94dd1f8ba9f589d72b7b52f3d8a8ea4012a7995d412e9021f0493e90be5
MD5 887fadca53a9f3368b741d5c37e30256
BLAKE2b-256 7c35dc139de1e877aa8953e66b1b5f28d04596aa4565bb9e7ef4f3f36123ed4b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sweetbean-1.3.14-py3-none-any.whl
  • Upload date:
  • Size: 50.2 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.14-py3-none-any.whl
Algorithm Hash digest
SHA256 f1dd68562a56f7f958e5b8796345ab45412b6fd082f5a3b83792d48abe672413
MD5 dcd7683f5849287a24950476648f728e
BLAKE2b-256 791b5b9f986b7e7e56a102db12f892451a99eb4a7460e3112c42e3f7ff43ed0d

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