pyevt


Namepyevt JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/MartinStokroos/pyevt
Summarypyevt library for EVT-2 devices
upload_time2025-08-11 13:48:20
maintainerMartin Stokroos
docs_urlNone
authorEise Hoekstra
requires_python<4.0,>=3.8
licenseGPL-3.0-or-later
keywords evt api usb hid psychology response-box
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyevt - A python binder for the Event-Exchanger EVT-2 USB hardware

## 1. About
This repository contains the code to communicate with *EVT-2* USB-devices, developed by the Research Support group of the faculty of Behavioral and Social Science from the University of Groningen. This code was originally written by Eise Hoekstra and Mark M. Span and is now maintained by Martin Stokroos

The *EVT-2* is an event marking and triggering device intended for physiological experiments.
*pyevt* is a Python module to communicate with *EVT-2* hardware (+derivatives).

## 2. Install
Install pyevt with:

`pip install pyevt` or
`pip install --user pyevt` on managed computers.

## 3. Dependencies
The *pyevt*-library uses the *HIDAPI* python module to communicate over USB according the HID class.
![https://pypi.org/project/hidapi/](https://pypi.org/project/hidapi/)

## 4. Device Permission for Linux
In Linux (Ubuntu), permission for using EVT (HID) devices should be given by adding the next lines to a file, for example named: `99-evt-devices.rules` in `/etc/udev/rules.d`:

```
# /etc/udev/rules.d/99-evt-devices.rules

# All EVT devices
SUBSYSTEM=="usb", ATTR{idVendor}=="0004", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0008", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0009", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0114", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0208", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0308", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0408", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0508", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0604", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0808", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0909", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="1803", MODE="0660", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="1807", MODE="0660", GROUP="plugdev"
```

The user should be a member of the `plugdev` -group.

Check with:

`$ groups username`

If this is not the case, add the user to the plugdev group by typing:

`$ sudo usermod -a -G plugdev username`

## 5. Python coding examples

```
from pyevt import EventExchanger

myevt = EventExchanger()
# Get list of devices containing the partial string 'partial_device_name'
myevt.scan('partial_device_name') # The default is 'EventExchanger'.

# Create a device handle:
myevt.attach_name('partial_device_name') # Example: 'EVT02', 'SHOCKER' or 'RSP-12', etc. The default is 'EventExchanger'.

myevt.write_lines(0) # clear outputs
myevt.pulse_lines(170, 1000) # value=170, duration=1000ms

# remove device handle
myevt.close()

# connect RSP-12
myevt.attach_name('RSP-12')
myevt.wait_for_event(3, None) # wait for button 1 OR 2, timeout is infinite.
myevt.close() # remove device handle

```

## 6. License
The evt-plugins collection is distributed under the terms of the GNU General Public License 3.
The full license should be included in the file COPYING, or can be obtained from

[http://www.gnu.org/licenses/gpl.txt](http://www.gnu.org/licenses/gpl.txt)

This plugin collection contains the work of others.

## 7. Documentation
Information about EVT-devices and OpenSesame plugins:

[https://markspan.github.io/evtplugins/](https://markspan.github.io/evtplugins/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MartinStokroos/pyevt",
    "name": "pyevt",
    "maintainer": "Martin Stokroos",
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": "m.stokroos@rug.nl",
    "keywords": "evt, api, usb, hid, psychology, response-box",
    "author": "Eise Hoekstra",
    "author_email": "eise@example.com",
    "download_url": "https://files.pythonhosted.org/packages/73/94/4c905b3d856275a300a9a4f7fea0cbf0b61abee37f4dca9a45eaf78d5c9e/pyevt-0.2.0.tar.gz",
    "platform": null,
    "description": "# pyevt - A python binder for the Event-Exchanger EVT-2 USB hardware\n\n## 1. About\nThis repository contains the code to communicate with *EVT-2* USB-devices, developed by the Research Support group of the faculty of Behavioral and Social Science from the University of Groningen. This code was originally written by Eise Hoekstra and Mark M. Span and is now maintained by Martin Stokroos\n\nThe *EVT-2* is an event marking and triggering device intended for physiological experiments.\n*pyevt* is a Python module to communicate with *EVT-2* hardware (+derivatives).\n\n## 2. Install\nInstall pyevt with:\n\n`pip install pyevt` or\n`pip install --user pyevt` on managed computers.\n\n## 3. Dependencies\nThe *pyevt*-library uses the *HIDAPI* python module to communicate over USB according the HID class.\n![https://pypi.org/project/hidapi/](https://pypi.org/project/hidapi/)\n\n## 4. Device Permission for Linux\nIn Linux (Ubuntu), permission for using EVT (HID) devices should be given by adding the next lines to a file, for example named: `99-evt-devices.rules` in `/etc/udev/rules.d`:\n\n```\n# /etc/udev/rules.d/99-evt-devices.rules\n\n# All EVT devices\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0004\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0008\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0009\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0114\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0208\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0308\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0408\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0508\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0604\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0808\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"0909\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"1803\", MODE=\"0660\", GROUP=\"plugdev\"\nSUBSYSTEM==\"usb\", ATTR{idVendor}==\"1807\", MODE=\"0660\", GROUP=\"plugdev\"\n```\n\nThe user should be a member of the `plugdev` -group.\n\nCheck with:\n\n`$ groups username`\n\nIf this is not the case, add the user to the plugdev group by typing:\n\n`$ sudo usermod -a -G plugdev username`\n\n## 5. Python coding examples\n\n```\nfrom pyevt import EventExchanger\n\nmyevt = EventExchanger()\n# Get list of devices containing the partial string 'partial_device_name'\nmyevt.scan('partial_device_name') # The default is 'EventExchanger'.\n\n# Create a device handle:\nmyevt.attach_name('partial_device_name') # Example: 'EVT02', 'SHOCKER' or 'RSP-12', etc. The default is 'EventExchanger'.\n\nmyevt.write_lines(0) # clear outputs\nmyevt.pulse_lines(170, 1000) # value=170, duration=1000ms\n\n# remove device handle\nmyevt.close()\n\n# connect RSP-12\nmyevt.attach_name('RSP-12')\nmyevt.wait_for_event(3, None) # wait for button 1 OR 2, timeout is infinite.\nmyevt.close() # remove device handle\n\n```\n\n## 6. License\nThe evt-plugins collection is distributed under the terms of the GNU General Public License 3.\nThe full license should be included in the file COPYING, or can be obtained from\n\n[http://www.gnu.org/licenses/gpl.txt](http://www.gnu.org/licenses/gpl.txt)\n\nThis plugin collection contains the work of others.\n\n## 7. Documentation\nInformation about EVT-devices and OpenSesame plugins:\n\n[https://markspan.github.io/evtplugins/](https://markspan.github.io/evtplugins/)\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "pyevt library for EVT-2 devices",
    "version": "0.2.0",
    "project_urls": {
        "Documentation": "https://github.com/MartinStokroos/pyevt/wiki",
        "Homepage": "https://github.com/MartinStokroos/pyevt",
        "Repository": "https://github.com/MartinStokroos/pyevt"
    },
    "split_keywords": [
        "evt",
        " api",
        " usb",
        " hid",
        " psychology",
        " response-box"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91af8e3971be0dc860884365edca64bbe48216d58b1711d527c7f496eb8a41cd",
                "md5": "6d69186f41c9efe6f9e8665556a3f973",
                "sha256": "3dc69482d05606637faf6e0a463806fdde0366091abaccd986db386194bce261"
            },
            "downloads": -1,
            "filename": "pyevt-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6d69186f41c9efe6f9e8665556a3f973",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 18004,
            "upload_time": "2025-08-11T13:48:18",
            "upload_time_iso_8601": "2025-08-11T13:48:18.768123Z",
            "url": "https://files.pythonhosted.org/packages/91/af/8e3971be0dc860884365edca64bbe48216d58b1711d527c7f496eb8a41cd/pyevt-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73944c905b3d856275a300a9a4f7fea0cbf0b61abee37f4dca9a45eaf78d5c9e",
                "md5": "72f46aadbb5056904cc78d97c3f5c8e1",
                "sha256": "0124046744a67b8330d726a2ff543d799e084da639fe733320fba20635d5709b"
            },
            "downloads": -1,
            "filename": "pyevt-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "72f46aadbb5056904cc78d97c3f5c8e1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 17319,
            "upload_time": "2025-08-11T13:48:20",
            "upload_time_iso_8601": "2025-08-11T13:48:20.517493Z",
            "url": "https://files.pythonhosted.org/packages/73/94/4c905b3d856275a300a9a4f7fea0cbf0b61abee37f4dca9a45eaf78d5c9e/pyevt-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-11 13:48:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MartinStokroos",
    "github_project": "pyevt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyevt"
}
        
Elapsed time: 2.14850s