Skip to main content

spike2py

License: GPL v3 Code style: black coverage Contributor Covenant Documentation Status

spike2py provides a simple interface to analyse and visualise data collected using Spike2 software and Cambridge Electronics Design (CED) data acquisition boards. With it you can easily plot individual channels or all channels from a given trial. In addition, you can easily apply various signal processing methods to your waveform data. Finally, you can easily save your data at any point, allowing you to re-open and continue your work from where they left off.

To demonstrate, the following snippet of code shows you how to:

  1. Read a file
  2. Plot the electromyography (EMG) signal from one of the channels
  3. Remove the mean of the first 500 samples and rectify EMG signal, and plot the result
>>> from spike2py.trial import TrialInfo, Trial
>>> trial_info = TrialInfo(file="sample.mat")
>>> sample = Trial(trial_info)
>>> sample.muscle_emg.plot()
>>> sample.muscle_emg.remove_mean(first_n_samples=500).rect().plot()

emg_raw

Documentation

Introductory tutorials, how-to's and other useful documentation are available on Read the Docs

Installing

spike2py is available on PyPI:

$ python -m pip install spike2py

spike2py officially supports Python 3.8+.

Caveat

spike2py works with Matlab files exported from Spike2 v7, or any other Spike2 version that exports to Matlab 5.0 format. Spike2 v10 exports files to Matlab 7.3 format, which is currently not supported by spike2py. The ability to open both Matlab file formats will be added in future version of spike2py.

Contributing

Like this project? Want to help? We would love to have your contribution! Please see CONTRIBUTING to get started.

Code of conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to heroux.martin@gmail.com.

License

GPLv3

Metadata

Release files for spike2py 0.2.10

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

Source distribution (sdist)

Source distribution for spike2py 0.2.10
File Size Uploaded
spike2py-0.2.10.tar.gz 30.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spike2py 0.2.10
File Interpreter ABI Platform
spike2py-0.2.10-py3-none-any.whl Python 3 none any Details

Total release size: 57.1 kB

Release files / spike2py-0.2.10.tar.gz

Download URL spike2py-0.2.10.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
45fc2e6d2e7f0d44487d2234029b8217173a8472b8c34fe47dfb8f1da53aa98b
BLAKE2b-256 checksum
How to use checksums
e35d8d7d723a87592a7ad113219bb9304eaef2364fba9bed924574574eb39455
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / spike2py-0.2.10-py3-none-any.whl

Download URL spike2py-0.2.10-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d71829781b02541b3626f20e2799b79bb726f13826fc61307cde1de2746c942
BLAKE2b-256 checksum
How to use checksums
719c686e3a610ebf9aac2b6ee1266b710979f2d71c275deb38284f0251929ef0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.2.10 This release

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

2 release files

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