stimuli


Namestimuli JSON
Version 0.5.0 PyPI version JSON
download
home_page
SummarySimple auditory and visual stimuli avoiding PsychoPy.
upload_time2024-02-05 13:31:29
maintainer
docs_urlNone
author
requires_python>=3.10
licenseMIT License Copyright (c) 2022 Mathieu Scheltienne Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords audio auditory python stimuli visual
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![codecov](https://codecov.io/gh/mscheltienne/simple-stimuli/branch/main/graph/badge.svg?token=92BKRPSD0V)](https://codecov.io/gh/mscheltienne/simple-stimuli)
[![tests](https://github.com/mscheltienne/simple-stimuli/actions/workflows/pytest.yaml/badge.svg?branch=main)](https://github.com/mscheltienne/simple-stimuli/actions/workflows/pytest.yaml)
[![doc](https://github.com/mscheltienne/simple-stimuli/actions/workflows/doc.yaml/badge.svg?branch=main)](https://github.com/mscheltienne/simple-stimuli/actions/workflows/doc.yaml)
[![PyPI version](https://badge.fury.io/py/stimuli.svg)](https://badge.fury.io/py/stimuli)
[![Downloads](https://static.pepy.tech/personalized-badge/stimuli?period=total&units=international_system&left_color=grey&right_color=blue&left_text=pypi%20downloads)](https://pepy.tech/project/stimuli)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/stimuli.svg)](https://anaconda.org/conda-forge/stimuli)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/stimuli.svg)](https://anaconda.org/conda-forge/stimuli)
[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/stimuli.svg)](https://anaconda.org/conda-forge/stimuli)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7470600.svg)](https://zenodo.org/records/7470600)

# Simple-stimuli

This repository contains simple auditory and visual stimuli that do not require
[PsychoPy](https://www.psychopy.org/). The auditory stimuli use the python
[sounddevice](https://python-sounddevice.readthedocs.io/en/0.4.4/) library and
the visual stimuli use the python [opencv](https://docs.opencv.org/4.x/)
library.

# Installation

This repository is available for `python ≥ 3.8` on `pip` with the command
`pip install stimuli` or on `conda-forge` with the command
`conda install -c conda-forge stimuli`.

# Usage

## Audio stimulus

```
from stimuli.audio import Tone

sound = Tone(volume=80, frequency=1000)
sound.play()
```

The volume can be set independently for each channel (stereo) by providing a tuple
`(L, R)`.

## Visual stimulus

Visual stimulus can be grouped into 2 categories:

- simple visuals that are drawn on top of each other
- feedback visuals that are drawn once and updated

### Simple visual

```
from stimuli.visuals import Text

visual = Text()
visual.background = "lightgrey"  # equivalent to visual.draw_background()
visual.putText("Top secret not-so-secret instructions!")
visual.show()
```

### Feedback visual

```
import numpy as np

from stimuli.visuals import FillingBar

visual = FillingBar()
visual.background = "lightgrey"  # equivalent to visual.draw_background()
visual.putBar(length=200, width=20, margin=2, color="black", fill_color="teal")

for k in np.arange(0, 1, 0.1):
    visual.fill_perc = k  # update the visual
    visual.show(100)  # wait 100 ms

visual.close()
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "stimuli",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Mathieu Scheltienne <mathieu.scheltienne@fcbg.ch>",
    "keywords": "audio,auditory,python,stimuli,visual",
    "author": "",
    "author_email": "Mathieu Scheltienne <mathieu.scheltienne@fcbg.ch>",
    "download_url": "https://files.pythonhosted.org/packages/4f/95/8402f90c808e80384fa5834420f8b21dc926c88bbf463c4196060095ef3c/stimuli-0.5.0.tar.gz",
    "platform": null,
    "description": "[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)\n[![codecov](https://codecov.io/gh/mscheltienne/simple-stimuli/branch/main/graph/badge.svg?token=92BKRPSD0V)](https://codecov.io/gh/mscheltienne/simple-stimuli)\n[![tests](https://github.com/mscheltienne/simple-stimuli/actions/workflows/pytest.yaml/badge.svg?branch=main)](https://github.com/mscheltienne/simple-stimuli/actions/workflows/pytest.yaml)\n[![doc](https://github.com/mscheltienne/simple-stimuli/actions/workflows/doc.yaml/badge.svg?branch=main)](https://github.com/mscheltienne/simple-stimuli/actions/workflows/doc.yaml)\n[![PyPI version](https://badge.fury.io/py/stimuli.svg)](https://badge.fury.io/py/stimuli)\n[![Downloads](https://static.pepy.tech/personalized-badge/stimuli?period=total&units=international_system&left_color=grey&right_color=blue&left_text=pypi%20downloads)](https://pepy.tech/project/stimuli)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/stimuli.svg)](https://anaconda.org/conda-forge/stimuli)\n[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/stimuli.svg)](https://anaconda.org/conda-forge/stimuli)\n[![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/stimuli.svg)](https://anaconda.org/conda-forge/stimuli)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7470600.svg)](https://zenodo.org/records/7470600)\n\n# Simple-stimuli\n\nThis repository contains simple auditory and visual stimuli that do not require\n[PsychoPy](https://www.psychopy.org/). The auditory stimuli use the python\n[sounddevice](https://python-sounddevice.readthedocs.io/en/0.4.4/) library and\nthe visual stimuli use the python [opencv](https://docs.opencv.org/4.x/)\nlibrary.\n\n# Installation\n\nThis repository is available for `python \u2265 3.8` on `pip` with the command\n`pip install stimuli` or on `conda-forge` with the command\n`conda install -c conda-forge stimuli`.\n\n# Usage\n\n## Audio stimulus\n\n```\nfrom stimuli.audio import Tone\n\nsound = Tone(volume=80, frequency=1000)\nsound.play()\n```\n\nThe volume can be set independently for each channel (stereo) by providing a tuple\n`(L, R)`.\n\n## Visual stimulus\n\nVisual stimulus can be grouped into 2 categories:\n\n- simple visuals that are drawn on top of each other\n- feedback visuals that are drawn once and updated\n\n### Simple visual\n\n```\nfrom stimuli.visuals import Text\n\nvisual = Text()\nvisual.background = \"lightgrey\"  # equivalent to visual.draw_background()\nvisual.putText(\"Top secret not-so-secret instructions!\")\nvisual.show()\n```\n\n### Feedback visual\n\n```\nimport numpy as np\n\nfrom stimuli.visuals import FillingBar\n\nvisual = FillingBar()\nvisual.background = \"lightgrey\"  # equivalent to visual.draw_background()\nvisual.putBar(length=200, width=20, margin=2, color=\"black\", fill_color=\"teal\")\n\nfor k in np.arange(0, 1, 0.1):\n    visual.fill_perc = k  # update the visual\n    visual.show(100)  # wait 100 ms\n\nvisual.close()\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2022 Mathieu Scheltienne  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Simple auditory and visual stimuli avoiding PsychoPy.",
    "version": "0.5.0",
    "project_urls": {
        "documentation": "https://mscheltienne.github.io/simple-stimuli/dev/index.html",
        "homepage": "https://mscheltienne.github.io/simple-stimuli/dev/index.html",
        "source": "https://github.com/mscheltienne/simple-stimuli",
        "tracker": "https://github.com/mscheltienne/simple-stimuli/issues"
    },
    "split_keywords": [
        "audio",
        "auditory",
        "python",
        "stimuli",
        "visual"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "293b50733055534fa1ea364850a92f4262af66d55d9c587386164f6e1401cf62",
                "md5": "b6eadcda7033136651fc533b6ced3df0",
                "sha256": "994661c3f915158f320a585b9ffdf4fd133b554fbc6d8dc23ac87d5c610b5804"
            },
            "downloads": -1,
            "filename": "stimuli-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b6eadcda7033136651fc533b6ced3df0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 50435,
            "upload_time": "2024-02-05T13:31:28",
            "upload_time_iso_8601": "2024-02-05T13:31:28.675675Z",
            "url": "https://files.pythonhosted.org/packages/29/3b/50733055534fa1ea364850a92f4262af66d55d9c587386164f6e1401cf62/stimuli-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4f958402f90c808e80384fa5834420f8b21dc926c88bbf463c4196060095ef3c",
                "md5": "23b5de3b2f24a7add487eee54dd3c953",
                "sha256": "9800a1223be1e4eb1a710770642fe6160e13c0c2feaee1a74141b0ce51082bdb"
            },
            "downloads": -1,
            "filename": "stimuli-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "23b5de3b2f24a7add487eee54dd3c953",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 30221,
            "upload_time": "2024-02-05T13:31:29",
            "upload_time_iso_8601": "2024-02-05T13:31:29.848283Z",
            "url": "https://files.pythonhosted.org/packages/4f/95/8402f90c808e80384fa5834420f8b21dc926c88bbf463c4196060095ef3c/stimuli-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-05 13:31:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mscheltienne",
    "github_project": "simple-stimuli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "stimuli"
}
        
Elapsed time: 0.39026s