A collection of scripts that run common stress tasks
Project description
SASHLab Stress CLI
Overview
SASHLab Stress is a collection of scripts that run common stress-inducing tasks, designed for use in psychology experiments or stress-response testing. The CLI is intended to facilitate the application of various stress protocols in a streamlined manner.
Features
The current script will run the available stress task for specified durations and save the output to an easily mungable CSV file.
Current stressors
-
Mental Arithmetic Task:
- A mental subtraction task where participants subtract digits under time pressure. Task difficulty adjusts based on streaks of correct or incorrect answers (streak length is 3).
-
Negative/Neutral Speech Task:
- A speech task where participants are asked to recall either negative or neutral experiences. The task condition (negative or neutral) is determined by the user.
Planned stressors
- Digit Span
- Nonsense Syllable
Installation
Ensure you have Python 3.12 or newer. To install the CLI, run:
pip install sashlab-stress
Usage
For the best results, ensure your terminal is pointed to the folder where you'd like participant data to be stored:
cd <path/to/your/project/data>
Run the main functionality of SASHLab Stress with default options:
sashlab_stress
Examples
-
To run the mental arithmetic stress task:
sashlab_stress --time-limit 600 --trial-time 20 --path ./data
-
To run the negative/neutral speech task in neutral condition:
sashlab_stress --task-type neg-neu-speech --condition 1 --time-limit 600 --path ./data
-
To show help and view available commands:
sashlab_stress --help
Options
-
--task-type
: The kind of task to run, either the mental subtraction task ('mental-subtraction') or the negative/neutral speech task ('neg-neu-speech').- Type:
str
- Default:
mental-subtraction
- Example:
--task-type neg-neu-speech
(runs the speech task)
- Type:
-
--time-limit
: Set the time limit for the entire session in seconds.- Type:
int
- Default:
300
seconds (5 minutes) - Example:
--time-limit 600
(Sets the session duration to 10 minutes)
- Type:
-
--trial-time
: Specify the maximum duration allowed for each individual trial before it times out due to lack of interaction.- Type:
int
- Default:
15
seconds - Example:
--trial-time 20
(Sets each trial timeout to 20 seconds)
- Type:
-
--path
: Provide the path where session data will be saved.- Type:
path
- Default: Current working directory (
cwd
) - Example:
--path ./data
(Saves session data to a folder named "data" in the current directory)
- Type:
-
--condition
: Set the condition for the speech task, with 0 representing negative condition and 1 representing neutral condition.- Type:
int
- Default:
0
(Negative condition) - Example:
--condition 1
(Runs the task in neutral condition)
- Type:
Dependencies
This project relies on the following packages:
- black (>=24.8.0): For code formatting.
- inputimeout (>=1.0.4): For handling time-based input during tasks.
- keyboard (>=0.13.5): To capture keyboard events during tasks.
All dependencies will be installed automatically with the package.
Requirements
- Python 3.12 or higher
- Operating System: OS Independent
Contributing
Contributions are welcome! If you have ideas for new stress tasks or improvements, feel free to open an issue or submit a pull request on the GitHub repository.
Authors
- Kevin O'Malley - kevomalley743@gmail.com
- Sandra O'Brien - sandra.obrien@ul.ie
License
This project is licensed under the MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sashlab_stress-0.1.5.tar.gz
.
File metadata
- Download URL: sashlab_stress-0.1.5.tar.gz
- Upload date:
- Size: 68.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc0fa19240c72e4fa54cc443c8dcab1f209dcc21a38a88b4d9381c8e5bc9dfdb |
|
MD5 | ed46241cae5ac3f5cdb45ead6996071b |
|
BLAKE2b-256 | 08537c7dd3aae45f4d4751813f612934650a0755d782f3d2af442d3af81ccfcf |
File details
Details for the file sashlab_stress-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: sashlab_stress-0.1.5-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8031b7e24b87fa15e4dfae6daa26eb137e2126184c21f933eef1a5ee0521c07c |
|
MD5 | 6949ef639c2a4f49bc18c7fe76337f42 |
|
BLAKE2b-256 | a2635d506666aeb1f98363078d23d2e1bf9f3827f041f2a73a578a9e9ce62fab |