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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sweetbean-1.3.12.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.12.tar.gz
Algorithm Hash digest
SHA256 721f750ec60a54abacba4f7c69f2281eaa5dfeb22dea545703c11fbdd01fe127
MD5 fb69dfc13ab5376a6e6b626c5a8d333b
BLAKE2b-256 3f91adb49a2a09873ad71f0fd60ffcfb63d577cdd7c61b5c06e4fed88cd530d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sweetbean-1.3.12-py3-none-any.whl
  • Upload date:
  • Size: 47.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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 0a9f654176782c93f64d107d22bc316c404a527d2fa90db11a5fed8ab5786a85
MD5 646bedbbd73c67544a45ab21b9c7a1e5
BLAKE2b-256 3e60750fb6aff63bec4562109153db0a64649145043fc4dca076d370245dab17

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