Skip to main content

alfred3-interact: Interactive web-experiments in alfred3

GitHub DOI pre-commit Run tests pytest-coverage

Alfred3-interact is a plugin for alfred3. It allows for the creation of interactive web experiments, predominantly in the social sciences. As prerequisites, you need to have Python 3.7 or newer and alfred3 v2.2.0 or newer installed.

Installation

$ pip3 install alfred3_interact

Documentation

Documentation for alfred3_interact is available here: Link to docs

Quick example

Below is an example script.py for creating an experiment with an asynchronous exchange of data between participants matching:

  1. Initialize a group spec and the alfred3_interact.MatchMaker during experiment setup
  2. Use a alfred3_interact.WaitingPage for matchmaking inside its wait_for hook method.
  3. Find a group via MatchMaker.match and bind it to the experiment plugins object.
  4. Now the group object is available in sections, pages, and elements through the experiment session object. You can use it to access data from other participants in the same group.
# script.py
import alfred3 as al
import alfred3_interact as ali

exp = al.Experiment()

@exp.setup
def setup(exp):
    spec = ali.SequentialSpec("role1", "role2", nslots = 10, name="mygroup")
    exp.plugins.mm = ali.MatchMaker(spec, exp=exp)


@exp.member
class Match(ali.WaitingPage):

    def wait_for(self):
        group = self.exp.plugins.mm.match()
        self.exp.plugins.group = group
        return True


@exp.member
class Success(al.Page):
    title = "Match successful"

    def on_exp_access(self):
        group = self.exp.plugins.group

        txt = f"You have successfully matched to role: {group.me.role}"
        self += al.Text(txt, align="center")

if __name__ == "__main__":
    exp.run()

The demo experiment can be started by executing the following command from the experiment directory (i.e. the directory in which you placed the script.py):

$ alfred3 run

Citation

Alfred3-interact was developed for research at the department for economic and social psychology, Georg-August-University Göttingen. If you are publishing research conducted using alfred3, the following citation is required:

Brachem, J. & Treffenstädt, C. (2021). Alfred3-interact - Interactive web experiments in alfred3. (Version x.x.x). Göttingen, Germany: https://doi.org/10.5281/zenodo.1437219

Metadata

Release files for alfred3-interact 0.4.1

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

Source distribution (sdist)

Source distribution for alfred3-interact 0.4.1
File Size Uploaded Provenance Actions
alfred3_interact-0.4.1.tar.gz 3.9 MB Without provenance Details for alfred3_interact-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for alfred3-interact 0.4.1
File Interpreter ABI Platform Actions
alfred3_interact-0.4.1-py3-none-any.whl Python 3 none any Details for alfred3_interact-0.4.1-py3-none-any.whl

Total release size: 4.0 MB

Release files / alfred3_interact-0.4.1.tar.gz

Download URL alfred3_interact-0.4.1.tar.gz
Size 3.9 MB
Tags Source
SHA-256 checksum
How to use checksums
a21be211d0a6ef07510a7b2e90f286f57d1f172c08c5ef2637fbd85b167633ff
BLAKE2b-256 checksum
How to use checksums
b977e3ab5a3bbdb41deefe4eee71998d639c5be7c76e5987bdc4befc1d178d07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / alfred3_interact-0.4.1-py3-none-any.whl

Download URL alfred3_interact-0.4.1-py3-none-any.whl
Size 44.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cffc626fae49ce93603fab7af052382ddb192edfcdf7d236af08814e45ad7466
BLAKE2b-256 checksum
How to use checksums
16e5d8166487553adc7fadfebb66ec7edfd8ec4446cfff398700944e7d821895
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for alfred3-interact 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files No provenance

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